Script Preparation code:
Tests:

Historical Performance Data aggregated from 10 community runs

Desktop Results:
Chrome 10 runs
Array.sort()
1.4M/s
Array.toSorted()
1.3M/s
[...Array].sort()
1.3M/s

Fastest: Array.sort() (1.1x faster)

View exact numbers
  • Array.sort(): 1,446,740 ops/sec
  • Array.toSorted(): 1,345,250 ops/sec
  • [...Array].sort(): 1,262,730 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
    Array.sort()
    Array.toSorted()
    [...Array].sort()

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:148.0) Gecko/20100101 Firefox/148.0
Firefox 148 on Mac OS X 10.15
View result in a separate tab
Array.sort()
622K/s
Array.toSorted()
559K/s
[...Array].sort()
532K/s
View exact numbers
Test name Executions per second
Array.sort() 622,335 Ops/sec
Array.toSorted() 559,287 Ops/sec
[...Array].sort() 532,101 Ops/sec