Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
string split (for real) vs spread vs array from
(version: 1)
Comparing performance of:
Array from vs Spread vs Split
Created:
7 months ago
by:
Guest
Go 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:
7 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Browser/OS:
Chrome 143 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Split
43.2M/s
Spread
26.5M/s
Array from
24.3M/s
View exact numbers
Test name
Executions per second
✓
Split
43,211,092 Ops/sec
Spread
26,503,302 Ops/sec
Array from
24,305,784 Ops/sec
Related benchmarks
string split vs spread vs array from
array.split vs array.from vs spread
string split vs spread vs array from 2
Comments
Confirm delete:
Do you really want to delete benchmark?