Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
for vs filter vs find 2
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/124.0.0.0 Safari/537.36
Browser:
Chrome 124
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
for
59704832.0 Ops/sec
filter
29795372.0 Ops/sec
Script Preparation code:
const links = [{ Rel: "modelSelectionSetup", Href: "http://localhost:8081/Embed/8184/4870/Setup/ComparisonSelection" }, { Rel: "comparisonSetup", Method: "GET", Href: "http://localhost:8081/Embed/8184/4870/45/Setup/RangeComparison" }];
Tests:
for
const links = [{ Rel: "modelSelectionSetup", Href: "http://localhost:8081/Embed/8184/4870/Setup/ComparisonSelection" }, { Rel: "comparisonSetup", Method: "GET", Href: "http://localhost:8081/Embed/8184/4870/45/Setup/RangeComparison" }]; for(let i=0; i<links.length; i++) { const link = links[i]; if (link.Rel == 'comparisonSetup') return link; }
filter
const links = [{ Rel: "modelSelectionSetup", Href: "http://localhost:8081/Embed/8184/4870/Setup/ComparisonSelection" }, { Rel: "comparisonSetup", Method: "GET", Href: "http://localhost:8081/Embed/8184/4870/45/Setup/RangeComparison" }]; return links.filter(x => x.Rel == 'comparisonSetup')[0];