Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Underscore 1.6 vss Underscore 1.9
(version: 2)
Comparing performance of:
Underscore 1.6 vs Underscore 1.9
Created:
6 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js'></script> <script type="text/javascript"> window.u1 = _; _ = null; </script> <script src='https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js'></script> <script type="text/javascript"> window.u2 = _; _ = null; </script>
Script Preparation code:
var data = u1.range(10000).map(function(i) { return { counter: i } }); function isOdd(num) { return num % 2 === 1; } function square(num) { return num * num; } function lessThanThreeDigits(num) { return num.toString().length < 3; }
Tests:
Underscore 1.6
var result = u1.chain(data) .map(item => item.counter) .filter(isOdd) .map(square) .filter(lessThanThreeDigits) .value();
Underscore 1.9
var result = u2.chain(data) .map(item => item.counter) .filter(isOdd) .map(square) .filter(lessThanThreeDigits) .value();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Underscore 1.6
Underscore 1.9
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'd be happy to explain the benchmark in detail. **Benchmark Definition** The benchmark is comparing two versions of the Underscore.js library: version 1.6 and version 1.9. The benchmark definition is provided as a JSON object, which includes: * A script preparation code that sets up two variables `u1` and `u2`, each referencing a different version of Underscore.js. The scripts also define three functions: `isOdd`, `square`, and `lessThanThreeDigits`. * An HTML preparation code that loads the two versions of Underscore.js. **Options Compared** The benchmark is comparing two options: 1. **Underscore.js 1.6**: This version is loaded as `u1` in the script preparation code. 2. **Underscore.js 1.9**: This version is loaded as `u2` in the script preparation code. **Pros and Cons of Each Approach** * **Underscore.js 1.6**: + Pros: This approach allows for direct comparison between two versions of Underscore.js, making it easy to see the performance differences. + Cons: This approach may not be representative of real-world usage, as it only tests a specific set of functions and data structures. * **Underscore.js 1.9**: + Pros: This approach allows for testing of newer versions of Underscore.js, which may include optimizations or changes that improve performance. + Cons: Similar to the 1.6 approach, this may not be representative of real-world usage. **Library and Its Purpose** Underscore.js is a popular JavaScript library that provides a set of functional programming helpers, such as `chain`, `map`, `filter`, and others. In this benchmark, Underscore.js is used to chain together these helper functions to perform a series of operations on an array of data. **Special JS Feature or Syntax** There are no special JavaScript features or syntaxes being tested in this benchmark. The code is simple and straightforward, using only basic JavaScript concepts. **Other Alternatives** If you're interested in comparing performance between different versions of Underscore.js or other libraries, here are some alternatives: * Use a testing framework like Jest or Mocha to write unit tests for your application. * Use a benchmarking library like BenchmarkJS or WebPageTest to run benchmarks on your application. * Compare the performance of different JavaScript implementations, such as V8 (Chrome) vs. SpiderMonkey (Firefox). In summary, this benchmark is comparing the performance of two versions of Underscore.js: 1.6 and 1.9. The benchmark uses a simple script preparation code to load the two versions and defines three functions to test their performance. While there are some pros and cons to each approach, the benchmark provides a useful comparison between the two versions.
Related benchmarks:
Lodash vs Ramda vs Underscore 1.9.0 - IE11 Compatible with vanilla
Underscore vs native
Lodash vs Ramda vs Underscore 1.5.2
underscore js
Comments
Confirm delete:
Do you really want to delete benchmark?