Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
jQuery hasClass vs jQuery data
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
jQuery data
3.7M/s
jQuery hasClass
3.0M/s
View exact numbers
Test name
Executions per second
✓
jQuery data
3,707,826 Ops/sec
jQuery hasClass
2,978,060 Ops/sec
HTML Preparation code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <div id="el" class="test" data-slot='0'></div>
Tests:
jQuery hasClass
$("#el").hasClass("test");
jQuery data
$("#el").data('slot');