Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Underscore vs native
(version: 4)
Comparing performance of:
Underscore vs Native
Created:
7 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.0/underscore.js"></script>
Script Preparation code:
var data = _.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
var result = _.chain(data) .map(item => item.counter) .filter(isOdd) .map(square) .filter(lessThanThreeDigits) .value();
Native
var result = data.map(item => item.counter) .filter(isOdd) .map(square) .filter(lessThanThreeDigits)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Underscore
Native
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
11 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser/OS:
Chrome 137 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Underscore
3085.6 Ops/sec
Native
3300.3 Ops/sec
Related benchmarks:
Lodash vs Ramda vs Underscore 1.9.0 - IE11 Compatible with vanilla
Lodash vs Ramda vs Underscore 1.9.0 vs native
Underscore 1.6 vss Underscore 1.9
underscore js
Comments
Confirm delete:
Do you really want to delete benchmark?