Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
string split vs spread vs array from 2
(version: 1)
Comparing performance of:
Array from vs Spread vs Split
Created:
5 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
var s1 = "foo.bar"; var s2 = "foo";
Tests:
Array from
var n1 = Array.from(s1) var n2 = Array.from(s2)
Spread
var n1 = [...s1]; var n2 = [...s2];
Split
var n1 = s1.split(""); var n2 = s2.split("");
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Array from
Spread
Split
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser/OS:
Chrome 142 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array from
37852456.0 Ops/sec
Spread
36925020.0 Ops/sec
Split
69581864.0 Ops/sec
Related benchmarks:
Array split vs Array split limit vs string substring
Array split vs string substring2
Array split vs string substring3
Array split vs string substring4
Array split vs string substring5
string split vs spread vs array from
array.split vs array.from
array.split vs array.from vs spread
string split (for real) vs spread vs array from
Comments
Confirm delete:
Do you really want to delete benchmark?