Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Chrome 128
Windows
Desktop
2 years ago
Benchmark.js
Search inside a HashMap of Strings (Vanilla JS)
1.9M/s
Search inside an Array of Strings (Vanilla JS)
1.8M/s
Using each (jQuery)
123K/s
Using find (jQuery)
78K/s
View exact numbers
Test name Executions per second
Search inside a HashMap of Strings (Vanilla JS) 1,909,542 Ops/sec
Search inside an Array of Strings (Vanilla JS) 1,837,482 Ops/sec
Using each (jQuery) 122,580 Ops/sec
Using find (jQuery) 77,947 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: