Minor nit I spotted when I am running applications that load many osim files (e.g. OSC's test suite) - the profiler notices that it's spending a large amount of time (5 % or so) compiling regex strings on the lines that are changed by this diff. This speedup only really affects initially loading older osim files (e.g. many of the example files in OpenSim/OSC).
Brief summary of changes
Make constructing a std::regex from a pattern string have a static function-scoped lifetime so it only happens once per application boot.
Fixes issue N/A
Minor nit I spotted when I am running applications that load many osim files (e.g. OSC's test suite) - the profiler notices that it's spending a large amount of time (5 % or so) compiling regex strings on the lines that are changed by this diff. This speedup only really affects initially loading older osim files (e.g. many of the example files in OpenSim/OSC).
Brief summary of changes
std::regex
from a pattern string have a static function-scoped lifetime so it only happens once per application boot.Testing I've completed
Looking for feedback on...
CHANGELOG.md (choose one)
This change is