Script Preparation code:
AخA
 
var testString = "<this is the first string>and this is the second string";
Tests:
  • substring

     
    var firstString = testString.substring(1,24);
    var secondString = testString.substring(26);
  • split

     
    var splitArray = testString.split('<')[1].split('>');
    var firstString = splitArray[0];
    var secondString = splitArray[1];
  • slice

     
    var firstString = testString.slice(1,24);
    var secondString = testString.slice(26);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    substring
    split
    slice

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36
Chrome 98 on Windows
View result in a separate tab
Test name Executions per second
substring 5463083.0 Ops/sec
split 2588543.5 Ops/sec
slice 5500284.0 Ops/sec