Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.from vs new Set - iterator as argument
(version: 1)
Comparing performance of:
array vs set
Created:
11 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
const map = new Map(([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).map(n => [n, { n: n }]));
Tests:
array
Array.from(map.values());
set
new Set(map.values());
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
array
set
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
11 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser/OS:
Chrome 137 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
array
19870278.0 Ops/sec
set
2035144.5 Ops/sec
Related benchmarks:
Array.from vs new Array
iterate over array
from vs map
Array.from() vs new Array() - map
.map() vs for-of + push
set vs array iteration many
Destructuring array iterator vs array iterator keys
Array.from() vs new Array().map()
Array.from vs Array().keys
Comments
Confirm delete:
Do you really want to delete benchmark?