Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0
Firefox 148
Windows
Desktop
3 months ago
Test name Executions per second
querySelectorAll + forEach 1819649.4 Ops/sec
getElementsByTagName + Array.from + forEach 2461930.5 Ops/sec
querySelectorAll + length + for 2915295.0 Ops/sec
getElementsByTagName + length + for 9264009.0 Ops/sec
querySelectorAll + dynamic length + for 2333055.5 Ops/sec
getElementsByTagName + dynamic length + for 5100520.0 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