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: 2 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36
Chrome 78 on Mac OS X 10.15.1
View result in a separate tab
Test name Executions per second
getElementById() 3887813.0 Ops/sec
getElementsByClassName() 2338466.0 Ops/sec
getElementsByTagName() 3525394.0 Ops/sec
querySelector(#id) 2472002.0 Ops/sec
querySelector(.id) 3576675.0 Ops/sec
querySelectorAll(#id) 1163902.0 Ops/sec
querySelectorAll(.id) 1638055.0 Ops/sec
jQuery(#id) 1424857.0 Ops/sec
jQuery(.id) 666854.7 Ops/sec
jQuery(tag#id) 446832.5 Ops/sec
jQuery(tag.id) 466869.7 Ops/sec
jQuery + getElementById 1803816.0 Ops/sec
jQuery + getElementsByClassName 569444.1 Ops/sec