HTML Preparation code:
Tests:
  • getElementById()

  • getElementsByClassName()

  • getElementsByTagName()

  • querySelector(#id)

  • querySelector(.id)

  • querySelectorAll(#id)

  • querySelectorAll(.id)

  • jQuery(#id)

  • jQuery(.id)

  • jQuery(tag#id)

  • jQuery(tag.id)

  • jQuery + getElementById

  • jQuery + getElementsByClassName

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    getElementById()
    getElementsByClassName()
    getElementsByTagName()
    querySelector(#id)
    querySelector(.id)
    querySelectorAll(#id)
    querySelectorAll(.id)
    jQuery(#id)
    jQuery(.id)
    jQuery(tag#id)
    jQuery(tag.id)
    jQuery + getElementById
    jQuery + getElementsByClassName

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: an hour ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
Firefox 72 on Windows
View result in a separate tab
Test name Executions per second
getElementById() 2247706.0 Ops/sec
getElementsByClassName() 1589881.0 Ops/sec
getElementsByTagName() 2084285.0 Ops/sec
querySelector(#id) 1390543.0 Ops/sec
querySelector(.id) 1308900.0 Ops/sec
querySelectorAll(#id) 772151.9 Ops/sec
querySelectorAll(.id) 930224.6 Ops/sec
jQuery(#id) 3744680.0 Ops/sec
jQuery(.id) 828325.3 Ops/sec
jQuery(tag#id) 480335.8 Ops/sec
jQuery(tag.id) 519384.2 Ops/sec
jQuery + getElementById 2184527.0 Ops/sec
jQuery + getElementsByClassName 717992.9 Ops/sec