Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
spread vs iterator for getting first element
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Linux
Device Platform:
Desktop
Date tested:
10 months ago
Test name
Executions per second
spread
57447008.0 Ops/sec
iterator
92643176.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const elements = new Set(Array.from({length:10000},(i) => i));
Tests:
spread
const v = [...elements][0];
iterator
function first(iter){ for(const v of iter) return v; return undefined; } const v = first(elements);