loot / libloot

A C++ library for accessing LOOT's metadata and sorting functionality.
GNU General Public License v3.0
32 stars 12 forks source link

Cache plugin name regex objects #83

Closed Ortham closed 2 years ago

Ortham commented 2 years ago

Compiling plugin regexes is responsible for 63% of the time spent calling MetadataList::FindPlugin, and 25% of the time spent constructing PluginItem objects in LOOT:

image

Ortham commented 2 years ago

With a global cache (static std::map<std::string, std::regex>) hacked in, things look a lot better:

Screenshot 2022-01-01 223401

Ortham commented 2 years ago

Done in 15781c9b6b37adce5460091dc9ef7cea51c0707b.