Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Underscore each vs forEach
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Browser:
Chrome 129
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Underscore
5037.9 Ops/sec
Native
5232.8 Ops/sec
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.0/underscore.js"></script>
Script Preparation code:
var data = [ 20, 25, 21, 24, 23, 39, 44, 33, 32, 31, 35, 28, 26, 29, 30, 36, 27, 3, 22, 47, 19, 15, 18, 34, 38, 2, 37, 40, 48, 46, 45, 41, 42, 43, 6, 1, 5, 16, 9, 17, 13, 14, 12, 8, 10, 11, 4, 7, ];
Tests:
Underscore
var result = _.each(data, (item, index) => { console.log(item); });
Native
var result = data.forEach((item, index) => { console.log(item); });