Script Preparation code:
AخA
 
var dateStrings = Array(10000).fill(null).map(() => (new Date()).toISOString());
var padDate = date => (date < 10 ? `0${date}` : date);
Tests:
  • Parse Date

     
    dateStrings.map((d) => {
      const date = new Date(d);
      return `${padDate(date.getDate())}.${padDate(date.getMonth() + 1)}.${padDate(date.getYear())}`;
    });
  • String split

     
    dateStrings.map((d) => {
      const [date, time] = d.split('T')
      const [year, month, day] = date.split('-');
      return `${day}.${month}.${year}`;
    });
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Parse Date
    String split

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Chrome 89 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Parse Date 85.4 Ops/sec
String split 127.1 Ops/sec