Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
jQuery 3.5 versus 1.12.4
(version: 0)
Comparing performance of:
1.12.4 vs 3.3.1 vs 3.4 vs 3.5
Created:
6 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src='https://code.jquery.com/jquery-1.12.4.min.js'></script> <script> var $jq1124 = $.noConflict(true); </script> <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> <script> var $jq331 = $.noConflict(true); </script> <script src="https://code.jquery.com/jquery-3.4.0.min.js"></script> <script> var $jq34 = $.noConflict(true); </script> <script src="https://code.jquery.com/jquery-3.5.0.min.js"></script> <script> var $jq35 = $.noConflict(true); </script> <div> <ul id="menu"> <li class="menu-item">1</li> <li class="menu-item">2</li> <li class="menu-item">3</li> <li class="menu-item">4</li> </ul> </div>
Script Preparation code:
function tests($) { $(".menu-item").eq(2).closest("ul").css({ "background-color": "red" }).parent().css({ "border": "1px solid blue" }).append($("<p></p>").text("Text.").css({ "background-color": "green" })).end().end().remove(); console.log('tests' + $); }
Tests:
1.12.4
tests($jq1124);
3.3.1
tests($jq331);
3.4
tests($jq34);
3.5
tests($jq35);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
1.12.4
3.3.1
3.4
3.5
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Browser/OS:
Firefox 140 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
1.12.4
31696.7 Ops/sec
3.3.1
45116.0 Ops/sec
3.4
33570.6 Ops/sec
3.5
37888.0 Ops/sec
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
Let's break down the provided benchmarking setup and explain what's being tested, compared, and considered. **Benchmark Definition** The benchmark definition is represented by the JSON object that defines a JavaScript function `tests($)`. This function takes a jQuery object `$` as an argument and performs some DOM manipulations on it. The specific operations include: 1. Selecting the 2nd element with class "menu-item" using `.eq(2)`. 2. Moving up the DOM tree until the nearest ancestor that has a `ul` element. 3. Setting the background color of this ancestor to red. 4. Moving down the DOM tree again until the parent element. 5. Setting its border style to blue. 6. Appending a new paragraph element with some text and setting its background color to green. 7. Removing all elements from the document. **Comparison Options** The benchmark compares four different versions of jQuery: 1. `3.5.0` (latest at the time of writing) 2. `3.4.0` 3. `3.3.1` Each version has its own instance of `$` defined using the `.noConflict()` method, which helps to avoid conflicts with other libraries. **Pros and Cons** Here are some pros and cons for each jQuery version: * **3.5.0**: Latest version at the time of writing, likely to have the most modern features and performance optimizations. + Pros: Modern features, high performance. + Cons: May introduce new bugs or compatibility issues. * **3.4.0**: Still a relatively recent version, with many of the same features as 3.5.0. + Pros: Stable, compatible with many older browsers. + Cons: Less modern features compared to 3.5.0. * **3.3.1**: Older version, but still widely used and supported by many browsers. + Pros: Well-established, familiar API, good performance for its age. + Cons: May not have the latest features or performance optimizations. **Library Used** The benchmark uses jQuery as a library to perform DOM manipulations. The specific versions of jQuery are loaded using script tags, with each version having its own instance of `$` defined using `.noConflict()`. **Special JS Feature/Syntax** There is no special JavaScript feature or syntax used in this benchmark that's not widely supported by modern browsers. **Other Alternatives** If you're looking for alternative benchmarks or comparisons, you might consider: * Using a different library like React or Vue.js instead of jQuery. * Comparing the performance of different JavaScript engines, such as V8 (Chrome) vs. SpiderMonkey (Firefox). * Benchmarking the performance of specific DOM manipulation techniques, such as using `querySelector` vs. `getElementsByClassName`. * Creating a benchmark that tests the performance of different rendering engines or graphics libraries. Keep in mind that these alternatives would require significant changes to the benchmark setup and may not be directly comparable to this jQuery-based benchmark.
Related benchmarks:
JQuery version speed test
jquery bench
jQuery 3.5 versus 1.11.0
JQuery Speed Testttxv
Comments
Confirm delete:
Do you really want to delete benchmark?