HTML Preparation code:
Script Preparation code:
Tests:
  • $.hasClass

  • RegExp

  • Dry RegExp

  • indexOf

  • classList

  • hasClassString

  • indexOf more than operator

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    $.hasClass
    RegExp
    Dry RegExp
    indexOf
    classList
    hasClassString
    indexOf more than operator

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4133.0 Safari/537.36 Edg/84.0.508.0
Chrome 84 on Windows
View result in a separate tab
Test name Executions per second
$.hasClass 786190.6 Ops/sec
RegExp 3424062.2 Ops/sec
Dry RegExp 1154993.4 Ops/sec
indexOf 4177220.5 Ops/sec
classList 3525022.8 Ops/sec
hasClassString 2540448.8 Ops/sec
indexOf more than operator 4210653.5 Ops/sec


;