array.from vs spread

Benchmark created on


Setup

const map = new Map();
[...Array(1000).keys()].forEach(i => map.set(i, i));

Test runner

Ready to run.

Testing in
TestOps/sec
Array.from Map.entries
const result = Array.from(map.entries())
ready
spread Map.entries
const result = [...map.entries()]
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.