Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0
Firefox 140
Windows
Desktop
8 months ago
Test name Executions per second
querySelectorAll + forEach 1266516.8 Ops/sec
getElementsByTagName + Array.from + forEach 1491236.4 Ops/sec
querySelectorAll + length + for 1923145.4 Ops/sec
getElementsByTagName + length + for 5128703.5 Ops/sec
querySelectorAll + dynamic length + for 1534497.2 Ops/sec
getElementsByTagName + dynamic length + for 2965264.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