Tests:

Historical Performance Data aggregated from 92 community runs

Desktop Results:
Chrome 71 runs
string compare simple
176.9M/s
special case
175.1M/s
int comparison
174.7M/s
string compare with locale
35.1M/s

Fastest: string compare simple (5.0x faster)

View exact numbers
  • string compare simple: 176,925,056 ops/sec
  • special case: 175,125,008 ops/sec
  • int comparison: 174,662,784 ops/sec
  • string compare with locale: 35,090,500 ops/sec
Firefox 10 runs
int comparison
1229.4M/s
string compare simple
1108.9M/s
special case
21.7M/s
string compare with locale
2.4M/s

Fastest: int comparison (519.2x faster)

View exact numbers
  • int comparison: 1,229,433,344 ops/sec
  • string compare simple: 1,108,936,064 ops/sec
  • special case: 21,680,546 ops/sec
  • string compare with locale: 2,367,838 ops/sec
Safari 5 runs
int comparison
509.2M/s
string compare with locale
51.5M/s
string compare simple
44.0M/s
special case
38.1M/s

Fastest: int comparison (13.4x faster)

View exact numbers
  • int comparison: 509,152,416 ops/sec
  • string compare with locale: 51,512,324 ops/sec
  • string compare simple: 44,037,416 ops/sec
  • special case: 38,067,936 ops/sec
Mobile Results:
Chrome 6 runs
string compare simple
93.5M/s
special case
92.3M/s
int comparison
89.7M/s
string compare with locale
21.8M/s

Fastest: string compare simple (4.3x faster)

View exact numbers
  • string compare simple: 93,460,424 ops/sec
  • special case: 92,250,752 ops/sec
  • int comparison: 89,717,232 ops/sec
  • string compare with locale: 21,764,748 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • 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 months ago)
Mozilla/5.0 (Android 10; Mobile; rv:130.0) Gecko/130.0 Firefox/130.0
Firefox Mobile 130 on Android
View result in a separate tab
int comparison
374.1M/s
string compare simple
370.2M/s
special case
4.7M/s
string compare with locale
236K/s
View exact numbers
Test name Executions per second
int comparison 374,125,184 Ops/sec
string compare simple 370,241,920 Ops/sec
special case 4,653,352 Ops/sec
string compare with locale 235,631 Ops/sec