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
spread operator
6.5M/s
uncached array.from
2.7M/s
cached array.from
771K/s
View exact numbers
Test name
Executions per second
✓
spread operator
6,533,459 Ops/sec
uncached array.from
2,731,312 Ops/sec
cached array.from
770,969 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);