HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 9 community runs

Desktop Results:
Chrome 9 runs
native - cached.
8.3M/s
native - global
5.3M/s
jQuery - find ~ cached.
718K/s
jQuery - find ~ without cache.
646K/s
jQuery - using context.
626K/s
jQuery init after using native DOM
529K/s
jQuery - using data attributes.
473K/s

Fastest: native - cached. (17.6x faster)

View exact numbers
  • native - cached.: 8,337,182 ops/sec
  • native - global: 5,312,168 ops/sec
  • jQuery - find ~ cached.: 717,598 ops/sec
  • jQuery - find ~ without cache.: 645,862 ops/sec
  • jQuery - using context.: 625,983 ops/sec
  • jQuery init after using native DOM: 528,533 ops/sec
  • jQuery - using data attributes.: 473,279 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    jQuery - find ~ cached.
    jQuery - find ~ without cache.
    native - global
    native - cached.
    jQuery - using context.
    jQuery - using data attributes.
    jQuery init after using native DOM

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0
Chrome 138 on Windows
View result in a separate tab
native - global
25.9M/s
native - cached.
25.8M/s
jQuery - find ~ cached.
1.6M/s
jQuery - find ~ without cache.
1.4M/s
jQuery init after using native DOM
1.3M/s
jQuery - using context.
1.1M/s
jQuery - using data attributes.
688K/s
View exact numbers
Test name Executions per second
native - global 25,943,236 Ops/sec
native - cached. 25,822,830 Ops/sec
jQuery - find ~ cached. 1,564,850 Ops/sec
jQuery - find ~ without cache. 1,434,935 Ops/sec
jQuery init after using native DOM 1,348,433 Ops/sec
jQuery - using context. 1,126,284 Ops/sec
jQuery - using data attributes. 688,067 Ops/sec