Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Comparing performance of: 1.4.4 vs 1.12.4 vs 2.2.4 vs 3.4.1
(version: 1)
Comparing performance of:
1.4.4 vs 1.12.4 vs 2.2.4 vs 3.4.1
Created:
6 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<div id="idSelector"></div> <div class="classSelector"></div> <ul id="iteration"> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> <div id="cssGetter" style="color: black;"></div> <div id="cssSetter" style="color: black;"></div> <div id="find"> <span></span> <div> <strong></strong> </div> </div> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"> </script> <script> var $jq144 = $.noConflict(true); </script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"> </script> <script> var $jq1124 = $.noConflict(true); </script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"> </script> <script> var $jq224 = $.noConflict(true); </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> </script> <script> var $jq341 = $.noConflict(true); </script>
Script Preparation code:
function tests($) { // Filter Next $('#iteration li').filter(':first').next(); // Filter Prev $('#iteration li').filter(':last').prev(); // Non-existant Class $('.someClass'); // Non-existant ID $('#someID'); // Find $('#find').find('strong'); // Set color $('#cssSetter').css('color', 'red'); // Get color $('#cssGetter').css('color'); // Iteration $('#iteration li').each(function(i, e) { i++; }); // Class selector $('.classSelector'); // ID selector $('#idSelector'); }
Tests:
1.4.4
tests($jq144);
1.12.4
tests($jq1124);
2.2.4
tests($jq224);
3.4.1
tests($jq341);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
1.4.4
1.12.4
2.2.4
3.4.1
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Browser/OS:
Chrome 129 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
1.4.4
24077.5 Ops/sec
1.12.4
41210.1 Ops/sec
2.2.4
44483.2 Ops/sec
3.4.1
40042.4 Ops/sec
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
Taking a deep breath, let's dive into explaining the benchmark. **Benchmark Purpose** The benchmark is designed to compare the performance of different jQuery versions (1.4.4, 1.12.4, 2.2.4, and 3.4.1) in a set of microbenchmarks. The benchmarks are designed to test various aspects of jQuery's functionality, such as filtering, finding, setting, and getting CSS styles, and iteration. **Options Compared** The benchmark compares the performance of each jQuery version on a Windows Desktop device running Chrome 129 browser. The options compared include: 1. Filtering: `$('#iteration li').filter(':first')` vs. `$('#iteration li').filter(':last')` 2. Non-existent class selector: `$('.someClass')` vs. No-op (no filtering) 3. Non-existent ID selector: `$('#someID')` vs. No-op 4. Finding a specific element: `$('#find').find('strong')` 5. Setting CSS style: `$('#cssSetter').css('color', 'red')` 6. Getting CSS style: `$('#cssGetter').css('color')` 7. Iteration: `$('#iteration li').each(function(i, e) { i++; })` **Pros and Cons of Different Approaches** 1. **Filtering**: The `.filter()` method is a common way to filter elements in jQuery. Using the first element (`:first`) vs. the last element (`:last`) may have different performance implications due to caching or indexing mechanisms used by the browser. 2. **Non-existent class selector**: Selecting an empty class (`$('.someClass')`) is likely to be faster than performing a non-existent filtering operation, as it avoids unnecessary work in the browser's DOM manipulation pipeline. 3. **Non-existent ID selector**: Similar to the previous point, selecting an empty ID (`$('#someID')`) is likely to be faster due to its minimal impact on the browser's DOM traversal and manipulation processes. 4. **Finding a specific element**: Using `find()` can be slower than using other methods like `$('.elementClass')`, as it may involve more complex matching logic in the browser. 5. **Setting CSS style**: Setting a CSS style can involve additional work for the browser, such as parsing the style string and updating internal state, which might impact performance. 6. **Getting CSS style**: Getting a CSS style is likely to be faster than setting one, as it typically involves less overhead in terms of parsing, processing, and updating internal state. **Other Considerations** * The benchmark uses Chrome 129 browser on a Windows Desktop device, which may not be representative for all users or devices. * The test cases are designed to target specific aspects of jQuery's functionality, but they might not cover all possible use cases or edge scenarios. * The benchmark results should be interpreted with caution, considering the possibility that the observed performance differences may be influenced by factors other than the actual difference in jQuery version. **Library Used** The benchmark uses jQuery as the primary library being tested. However, it's essential to note that this benchmark does not evaluate the overall quality or stability of jQuery but rather focuses on specific aspects of its performance under different versions. Now, with a sense of accomplishment, we've dove into the details of this benchmark!
Related benchmarks:
JQuery 1.11.1 vs 2.1.4 vs 3.3.1
JQuery 1.11.1 vs 2.1.4 vs 3.3.1 vs 1.12.4
Jquery versions Benchmark 3.1.1 vs 3.4.1
jQuery 1.8.2 vs 3.4.1
jquery/1.4.3 vs 3.7.1
Comments
Confirm delete:
Do you really want to delete benchmark?