Tests:
-
Use hasClass shorthand
-
Use classList
-
Use classname match
Rendered benchmark preparation results:
Latest run results:
Run details: (Test run date:
3 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36
Chrome 147 on Windows
View result in a separate tab
Use classname match
3.8M/s
Use hasClass shorthand
551K/s
View exact numbers
| Test name |
Executions per second |
|
✓
Use classList
|
18,932,222 Ops/sec |
|
Use classname match
|
3,757,173 Ops/sec |
|
Use hasClass shorthand
|
550,654 Ops/sec |
Do you really want to delete benchmark?