2 ms·
I'm a sucker for random benchmarks, and seeing there was a benchmark against the hostname-lookup stuff, I took a quick shot (2015 MacBook Pro, running High Sier
by Twirrim 8y ago
I'm a sucker for random benchmarks, and seeing there was a benchmark against the hostname-lookup stuff, I took a quick shot (2015 MacBook Pro, running High Sierra)
Anyone know why regex performance on Safari is so diabolically bad?
Safari 12.0.1 on OS X 10.13.6.
Test 100 needles against 16 dictionaries of hostnames
- Set-based x 3,149 ops/sec ±0.75% (59 runs sampled)
- Regex-based x 281 ops/sec ±0.78% (61 runs sampled)
- Trie-based (1st-gen) x 14,118 ops/sec ±1.66% (66 runs sampled)
- Trie-based JS (2nd-gen) x 12,349 ops/sec ±0.58% (61 runs sampled)
Chrome 70.0.3538.110 on OS X 10.13.6 64-bit.
Test 100 needles against 16 dictionaries of hostnames
- Set-based x 3,376 ops/sec ±1.95% (61 runs sampled)
- Regex-based x 4,492 ops/sec ±1.66% (27 runs sampled)
- Trie-based (1st-gen) x 9,431 ops/sec ±0.69% (51 runs sampled)
- Trie-based JS (2nd-gen) x 8,627 ops/sec ±0.63% (47 runs sampled)
- Trie-based WASM (2nd-gen) x 12,169 ops/sec ±0.58% (64 runs sampled)
Done.