Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Converting a small Set to an Array
Return a new Array containing all elements in a Set in insertion order.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Spread operator (...)
20961132.0 Ops/sec
Array.from()
19841234.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/* This "JavaScript preparation code" is executed just once in each run. Therefore, although `s` randomly generated, consistency is unaffected because the same object is used across all test cases below. */ const s = new Set(); for (let i = 0; i < 10; ++i) { s.add(Math.random()); }
Tests:
Spread operator (...)
const a = [...s];
Array.from()
const a = Array.from(s);