Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
set + array.from + map vs map + set
(version: 0)
Comparing performance of:
map + set vs set + array.from + map
Created:
3 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var array = [] for (let i = 0; i < 10000; i++) { array.push(Math.round(Math.random() * 100)) }
Tests:
map + set
const set = new Set() array.map((item) => { if (set.has(item)) { set.add(item) return item } })
set + array.from + map
const set = new Set(array) Array.from(set).map((item) => { return item })
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
map + set
set + array.from + map
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Fill array with random integers
Array push or set
new Array() vs Array.from() with random data
Array.from() vs new Array() vs push
Spread Operator VS Array.prototype.slice() VS Array.prototype.map()
Comments
Confirm delete:
Do you really want to delete benchmark?