Script Preparation code:
AخA
 
FORMAT = { day: '2-digit', month: 'short', year: 'numeric' }
cache = new Map()
Tests:
  • No caching

     
    const date = new Intl.DateTimeFormat('en-AU', FORMAT).format(new Date())
  • With JSON-keyed cache

     
    const key = JSON.stringify(FORMAT)
    let formatter = cache.get(key)
    if (!formatter) {
      formatter = new Intl.DateTimeFormat('en-AU', FORMAT)
      cache.set(key, formatter)
    }
    const date = formatter.format(new Date())
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    No caching
    With JSON-keyed cache

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
No caching 39791.9 Ops/sec
With JSON-keyed cache 1561063.1 Ops/sec