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 [year, month, day] = d.split('T')[0].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: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Chrome 108 on Windows
View result in a separate tab
Test name Executions per second
Parse Date 106.1 Ops/sec
String split 216.2 Ops/sec