Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0
Firefox 119
Windows
Desktop
one year ago
Test name Executions per second
querySelectorAll + forEach 752203.2 Ops/sec
getElementsByTagName + Array.from + forEach 854867.8 Ops/sec
querySelectorAll + length + for 1158108.1 Ops/sec
getElementsByTagName + length + for 4653628.5 Ops/sec
querySelectorAll + dynamic length + for 1063859.5 Ops/sec
getElementsByTagName + dynamic length + for 2370131.2 Ops/sec
HTML Preparation code:
Tests:
  • querySelectorAll + forEach

  • getElementsByTagName + Array.from + forEach

  • querySelectorAll + length + for

  • getElementsByTagName + length + for

  • querySelectorAll + dynamic length + for

  • getElementsByTagName + dynamic length + for


;