Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JQuery 1.11.1 vs 2.1.4 vs 3.3.1 vs 1.12.4
(version: 0)
SImple benchmark of jQuery versions
Comparing performance of:
1.11.1 vs 2.1.4 vs 3.3.1 vs 1.12.4
Created:
7 years ago
by:
Guest
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.11.1/jquery.min.js"> </script> <script> var $jq111 = $.noConflict(true); </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"> </script> <script> var $jq214 = $.noConflict(true); </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <script> var $jq331 = $.noConflict(true); </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"> </script> <script> var $jq124 = $.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.11.1
tests($jq111);
2.1.4
tests($jq214);
3.3.1
tests($jq331);
1.12.4
tests($jq124);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
1.11.1
2.1.4
3.3.1
1.12.4
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
I'll do my best to break down what's being tested in this benchmark and explain the different approaches. **What is being tested?** The benchmark measures the performance of four different jQuery versions (1.11.1, 2.1.4, 3.3.1, and 1.12.4) on a specific test case. The test case consists of a set of JavaScript functions that exercise various jQuery features, such as filtering, iteration, class selectors, ID selectors, and CSS manipulation. **Options being compared** The benchmark compares the performance of each jQuery version in terms of the number of executions per second (ExecutionsPerSecond) on a desktop device running Chrome 73. The test cases are identical for all four versions, but the JavaScript context (`$`) is bound to a different jQuery instance using `$ = $.noConflict(true);`, which means that each version is tested with a separate instance of jQuery. **Pros and Cons of different approaches** 1. **Separate instances of jQuery**: Using separate instances of jQuery for each test case allows for fair comparison between versions, as the performance differences are likely due to the JavaScript engine or other factors specific to each version rather than interference from shared functionality. 2. **NoConflict mode**: Binding `$` to a different instance using `$.noConflict(true)` ensures that each test case uses a unique jQuery context, which helps prevent interference and ensures accurate results. **Library: jQuery** jQuery is a popular JavaScript library used for DOM manipulation, event handling, and Ajax interactions. It provides an easy-to-use API for working with HTML documents and dynamic content. In this benchmark, jQuery is used to implement the various test cases, which exercise different aspects of its functionality. **Special JS feature or syntax: `$.noConflict()`** `$.noConflict()` is a jQuery method that returns a new version of the `$` variable without any conflicts. This allows developers to use multiple versions of jQuery in a single project without interference between them. In this benchmark, each test case uses a separate instance of jQuery by binding `$` to a different instance using `$.noConflict(true)`. **Other alternatives** If you were to rewrite this benchmark using alternative JavaScript libraries or approaches, here are some options to consider: 1. **Vanilla JavaScript**: Using only native JavaScript functions and methods could provide a more straightforward comparison between versions. 2. **Preact**: Preact is a lightweight alternative to React that shares many similarities with jQuery's DOM manipulation capabilities. 3. **V8**: Running the benchmark using the V8 JavaScript engine, which powers Google Chrome, would allow for direct comparisons between different jQuery versions and native JavaScript implementations. Keep in mind that each of these alternatives would require significant changes to the benchmark code and test cases to ensure accurate results.
Related benchmarks:
JQuery 1.11.1 vs 2.1.4 vs 3.3.1
Jquery versions Benchmark 3.1.1 vs 3.4.1
Jquery versions Benchmarch (latest - 3.5.1)
Jquery versions Benchmarch 3.6
Comments
Confirm delete:
Do you really want to delete benchmark?