Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
Chrome 87
Linux
Desktop
3 years ago
Test name Executions per second
Using each (jQuery) 149937.5 Ops/sec
Using find (jQuery) 100111.6 Ops/sec
Search inside an Array of Strings (Vanilla JS) 2529148.0 Ops/sec
Search inside a HashMap of Strings (Vanilla JS) 2767045.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Using each (jQuery)

  • Using find (jQuery)

  • Search inside an Array of Strings (Vanilla JS)

  • Search inside a HashMap of Strings (Vanilla JS)