Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122
Windows
Desktop
2 years ago
Benchmark.js
Search inside a HashMap of Strings (Vanilla JS)
1.2M/s
Search inside an Array of Strings (Vanilla JS)
1.0M/s
Using each (jQuery)
80K/s
Using find (jQuery)
51K/s
View exact numbers
Test name Executions per second
Search inside a HashMap of Strings (Vanilla JS) 1,206,065 Ops/sec
Search inside an Array of Strings (Vanilla JS) 1,036,566 Ops/sec
Using each (jQuery) 80,387 Ops/sec
Using find (jQuery) 51,141 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: