Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.from vs RegExp.match(/[\s\S]/gu)
(version: 1)
Comparing performance of:
Array.from vs string split
Created:
one year ago
by:
Guest
Go to the latest result
Script Preparation code:
var s1 = String.fromCodePoint(...crypto.getRandomValues(new Uint8Array(1024))); var s2 = String.fromCodePoint(...crypto.getRandomValues(new Uint8Array(4096)));
Tests:
Array.from
let n1 = Array.from(s1); let n2 = Array.from(s2);
string split
let n1 = s1.match(/[\s\S]/gu); let n2 = s2.match(/[\s\S]/gu);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array.from
string split
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0
Browser/OS:
Firefox 133 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Array.from
11K/s
string split
6K/s
View exact numbers
Test name
Executions per second
✓
Array.from
11,386 Ops/sec
string split
5,699 Ops/sec
Related benchmarks
String compare VS regex
RegEx vs For Loop 2
Array from vs string split
Regex vs Forloop Performance
Regex vs String.includes in Array.filter v2
Array from vs string split (modified with long strings)
Array from vs string split vs spread
Comments
Confirm delete:
Do you really want to delete benchmark?