Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make UUID validation RegEx a static class member
When analyzing a callgrind profile of a full library rescan, I noticed that there are a lot of CPU instructions coming from libpcre2, with the call originating in the UUID validation code. Previously, the regular expression used for UUID validation was parsed from a string for every invocation of the validation function. This is unnecessary. A library rescan will validate thousands of UUIDs (roughly 250k calls to `Uuid::isValid` with 200'000 instructions per call on my laptop for a library rescan). By moving the code to a static class member, I achieved a 15% speedup for a full library scan.
- Loading branch information