Tests:
  • int comparison

    AخA
     
    const a = 1582804062513
    const b = 1592804062513
    const c = b - a
    const d = a - b
  • string compare with locale

     
    const a = "1582804062513_note"
    const b = "1592804062513_note"
    const c = a.localeCompare(b)
    const d = b.localeCompare(a)
  • string compare simple

     
    const a = "1582804062513"
    const b = "1592804062513"
    const c = a > b
    const d = b < c
  • special case

     
    const a = "1582804062513_note".substring(0, 13)
    const b = "1592804062513_note".substring(0, 13)
    const c = a > b
    const d = b < c
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    int comparison
    string compare with locale
    string compare simple
    special case

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 21 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:137.0) Gecko/20100101 Firefox/137.0
Firefox 137 on Windows
View result in a separate tab
Test name Executions per second
int comparison 816300416.0 Ops/sec
string compare with locale 2144718.0 Ops/sec
string compare simple 744194944.0 Ops/sec
special case 14485697.0 Ops/sec