4 ms·
Not ideal. It is very slow. It takes 8 seconds for 3400 strings. That might be fine for occasional offline usage, but not for frequent usage, and certainly not
by tgv 2y ago
Not ideal. It is very slow. It takes 8 seconds for 3400 strings. That might be fine for occasional offline usage, but not for frequent usage, and certainly not for use in the backend (although I agree it should not be used there). I guess it matches all regexps against each string.
It also misses some really common user agents, basically all iOS 11 and 12. They may be rare nowadays, but they still occur.
- mpcjanssen 2y agoIt seems to recompile every regex on every matching operation. This is really slow. The compiled regexes should be cached in the different matchers.
- dineshgowda24 2y agoGood point. I didn't give much attention to this part. I run some benchmarks and move these to compile only once. Thank you.
- dangcoderevue 2y ago[dead]