Script Preparation code:
AخA
 
string = "This is a benchmark to test if matching a regex is faster that splitting a string";
regex = /\S+/gi;
Tests:
  • String.split

     
    string.split(/|s/)
  • Regex.match

     
    string.match(regex)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    String.split
    Regex.match

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0
Chrome 127 on Linux
View result in a separate tab
Test name Executions per second
String.split 140448.9 Ops/sec
Regex.match 639814.1 Ops/sec