Script Preparation code:
x
 
var s1 = "2021-01-01T01:01:01";
Tests:
  • Array.split

     
    var n1 = s1.split("T")[0];
  • Substring

     
    var n1 = s1.substring(0, 10);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.split
    Substring

    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; rv:93.0) Gecko/20100101 Firefox/93.0
Firefox 93 on Windows
View result in a separate tab
Test name Executions per second
Array.split 7717883.0 Ops/sec
Substring 125782160.0 Ops/sec