Script Preparation code:
Tests:

Historical Performance Data aggregated from 189 community runs

Desktop Results:
Chrome 142 runs
Intl.Collator.compare()
8.3M/s
localeCompare()
306K/s

Fastest: Intl.Collator.compare() (27.1x faster)

View exact numbers
  • Intl.Collator.compare(): 8,287,499 ops/sec
  • localeCompare(): 305,808 ops/sec
Firefox 33 runs
Intl.Collator.compare()
14.3M/s
localeCompare()
353K/s

Fastest: Intl.Collator.compare() (40.4x faster)

View exact numbers
  • Intl.Collator.compare(): 14,251,119 ops/sec
  • localeCompare(): 352,545 ops/sec
Safari 9 runs
Intl.Collator.compare()
7.6M/s
localeCompare()
204K/s

Fastest: Intl.Collator.compare() (37.3x faster)

View exact numbers
  • Intl.Collator.compare(): 7,601,384 ops/sec
  • localeCompare(): 203,664 ops/sec
Mobile Results:
Safari 5 runs
Intl.Collator.compare()
5.8M/s
localeCompare()
215K/s

Fastest: Intl.Collator.compare() (27.0x faster)

View exact numbers
  • Intl.Collator.compare(): 5,803,066 ops/sec
  • localeCompare(): 214,679 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
    localeCompare()
    Intl.Collator.compare()

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Chrome 149 on Mac OS X 10.15.7
View result in a separate tab
Intl.Collator.compare()
26.7M/s
localeCompare()
798K/s
View exact numbers
Test name Executions per second
Intl.Collator.compare() 26,696,784 Ops/sec
localeCompare() 798,491 Ops/sec