1
0
mirror of synced 2025-01-09 05:01:38 +01:00
ImHex/plugins/script_loader
Shubhankar Sarangi 4fcf732814
impr: Reserve space to avoid multiple allocations when loading scripts (#1929)
std::forward ensures that the arguments are perfectly forwarded to
loadScript
By reserving space in the features vector based on the size of scripts,
we can avoid multiple memory allocations during the loop. If an
exception occurs, returning an empty vector immediately clarifies that
no scripts were loaded. Without reservation, each call to emplace_back
could potentially trigger a reallocation if the current capacity is
exceeded, which is costly in terms of performance. This leads to more
efficient memory management and can significantly speed up the execution
time when dealing with a large number of scripts.


![image](https://github.com/user-attachments/assets/3e290162-fb8b-4f00-a71b-6009494b2dab)
2024-11-24 11:28:45 +01:00
..
include/loaders fix: Don't unload background .NET scripts 2024-06-07 21:27:01 +02:00
romfs/lang lang: Update Chinese (Simplified) translations (#1894) 2024-09-15 15:17:25 +02:00
source impr: Reserve space to avoid multiple allocations when loading scripts (#1929) 2024-11-24 11:28:45 +01:00
support impr: Added support for returning results from scripts 2024-05-18 12:57:29 +02:00
templates/CSharp impr: Added support for returning results from scripts 2024-05-18 12:57:29 +02:00
CMakeLists.txt build: Streamline definition on plugin features 2024-07-08 18:12:46 +02:00