Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array vs Generator
(version: 0)
Comparing performance of:
Generator vs Array
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var map = new Map() for (let i = 0; i < 100000; i++) { map.set(i.toString()+"_", i) }
Tests:
Generator
function* transform(input) { for (const [k,v] of input) { yield [k+"_2", v] } } const newMap = new Map(transform(map))
Array
const newMap = new Map([...map].map(([k,v])=>[k+"_2", v]))
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Generator
Array
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:
map vs forEach Chris
map vs forEach Chris v2
map vs forEach Chris v2b
for vs foreach vs map 2
Array fill method vs for loop vs map
Comments
Confirm delete:
Do you really want to delete benchmark?