Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
for vs find
Testing loop performance
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
for
877230.4 Ops/sec
find
11083220.0 Ops/sec
Script Preparation code:
var users = [{name:'testsubject1',id:2134,poo:0}, {name:'testsubject2',id:6342,poo:0}, {name:'testsubject3',id:2456,poo:0}, {name:'testsubject4',id:7658,poo:0}, {name:'testsubject5',id:6453,poo:0}, {name:'testsubject6',id:8966,poo:0}, {name:'testsubject7',id:356,poo:0}, {name:'testsubject8',id:356756,poo:0}];
Tests:
for
for (var i = 0; i < users.length; i++) users[i].poo += 123;
find
users.find(function(u){u.poo += 123;});