<script src='//code.jquery.com/jquery-1.12.4.min.js'></script>
<script>
var $jq1124 = $.noConflict(true);
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js">
</script>
<script>
var $jq224 = $.noConflict(true);
</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
var $jq331 = $.noConflict(true);
</script>
<div>
<ul id="menu">
<li class="menu-item">
</li>
<li class="menu-item">
</li>
<li class="menu-item">
</li>
<li class="menu-item">
</li>
</ul>
</div>
function tests($) {
$('#menu').css({
'backgroud': 'red'
});
$('.menu-item').eq(2).hasClass('foo');
}
tests($jq1124);
tests($jq224);
tests($jq331);
--enable-precise-memory-info
flag.
Test case name | Result |
---|---|
$jq1124 | |
$jq224 | |
$jq331 |
Test name | Executions per second |
---|---|
$jq1124 | 902214.8 Ops/sec |
$jq224 | 1008979.8 Ops/sec |
$jq331 | 898485.2 Ops/sec |
This benchmark tests the performance of three different versions of the jQuery library:
The benchmark measures how quickly each version can execute the following JavaScript code:
Options Compared:
The options compared are different jQuery versions, highlighting how performance can vary across releases.
Pros/Cons and Considerations:
Library:
Alternatives:
There are several alternatives to jQuery for accomplishing similar tasks:
Let me know if you'd like to delve deeper into any specific aspect of this benchmark!