Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Underscore pluck vs map 4
(version: 0)
Comparing performance of:
Underscore vs Native
Created:
4 years ago
by:
Guest
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 = [ {id: 1, status:'ok'}, {id: 2, status:'ok'}, {id: 3, status:'ok'}, {id: 4, status:'ok'}, {id: 5, status:'ok'}, {id: 6, status:'ok'}, {id: 7, status:'ok'}, {id: 8, status:'ok'}, {id: 9, status:'ok'}, {id: 10, status:'ok'}, {id: 1, status:'ok'}, {id: 2, status:'ok'}, {id: 3, status:'ok'}, {id: 4, status:'ok'}, {id: 5, status:'ok'}, {id: 6, status:'ok'}, {id: 7, status:'ok'}, {id: 8, status:'ok'}, {id: 9, status:'ok'}, {id: 10, status:'ok'}, {id: 1, status:'ok'}, {id: 2, status:'ok'}, {id: 3, status:'ok'}, {id: 4, status:'ok'}, {id: 5, status:'ok'}, {id: 6, status:'ok'}, {id: 7, status:'ok'}, {id: 8, status:'ok'}, {id: 9, status:'ok'}, {id: 10, status:'ok'}, {id: 1, status:'ok'}, {id: 2, status:'ok'}, {id: 3, status:'ok'}, {id: 4, status:'ok'}, {id: 5, status:'ok'}, {id: 6, status:'ok'}, {id: 7, status:'ok'}, {id: 8, status:'ok'}, {id: 9, status:'ok'}, {id: 10, status:'ok'}, {id: 1, status:'ok'}, {id: 2, status:'ok'}, {id: 3, status:'ok'}, {id: 4, status:'ok'}, {id: 5, status:'ok'}, {id: 6, status:'ok'}, {id: 7, status:'ok'}, {id: 8, status:'ok'}, {id: 9, status:'ok'}, {id: 10, status:'ok'}, ];
Tests:
Underscore
var result = _.pluck(data, "id");
Native
var result = data.forEach(item => item.id);
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:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Browser/OS:
Chrome 127 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Underscore
724301.4 Ops/sec
Native
6008181.0 Ops/sec
Related benchmarks:
Loop perf
Underscore pluck vs map 2
Underscore pluck vs map 5
filter + map vs flatMap
Comments
Confirm delete:
Do you really want to delete benchmark?