Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.from vs native from
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Linux
Device Platform:
Desktop
Date tested:
10 months ago
Test name
Executions per second
Array.from
19408.8 Ops/sec
native from
141594.9 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function from1(ArrayLike, map, thisArg) { return 'length' in ArrayLike ? map ? [].map.call(ArrayLike, map, thisArg) : [].slice.call(ArrayLike) : map ? Array.from(ArrayLike, map, thisArg) : [...ArrayLike] } let from2 = Array.from let arr = Array.from({length:1e3},(a,i)=>i), set = new Set(arr), generic = {length: 1e3}
Tests:
Array.from
from2(arr) from2(set) from2(generic)
native from
from1(arr) from1(set) from1(generic)