Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
triemux: make shouldRedirToLowercase more efficient by regex compilat…
…ion+reuse This change makes shouldRedirToLowercase more efficient by at start-up time compiling the regular expression that shouldRedirToLowercase uses instead of compiling and discarding it each time on a hit, with an exhibit below of the performance improvement: ```shell $ benchstat before.txt after.txt name old time/op new time/op delta ShouldRedirectToLowercasePath-8 29.8µs ± 1% 0.8µs ±24% -97.15% (p=0.000 n=8+10) name old alloc/op new alloc/op delta ShouldRedirectToLowercasePath-8 33.7kB ± 0% 0.0kB -100.00% (p=0.000 n=9+10) name old allocs/op new allocs/op delta ShouldRedirectToLowercasePath-8 360 ± 0% 0 -100.00% (p=0.000 n=10+10) ``` Fixes #444
- Loading branch information