Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
fastest way to convert set to array
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/126.0.0.0 Safari/537.36
Browser:
Chrome 126
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
spread operator
6533459.0 Ops/sec
cached array.from
770969.0 Ops/sec
uncached array.from
2731311.8 Ops/sec
Script Preparation code:
var set = new Set([1,41,23,12321,-3, .13, () => {}, {}, []]); var arrFrom = Array.from;
Tests:
spread operator
[...set];
cached array.from
arrFrom(set);
uncached array.from
Array.from(set);