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: 2 hours ago)
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0
Firefox 137 on Ubuntu
View result in a separate tab
Test name Executions per second
int comparison 2572676352.0 Ops/sec
string compare with locale 4794446.5 Ops/sec
string compare simple 2642817792.0 Ops/sec
special case 41331164.0 Ops/sec