Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Sort vs ToSorted 100k
(version: 1)
test
Comparing performance of:
sort vs toSorted vs sort reverse vs toSorted reverse
Created:
12 days ago
by:
Guest
Jump to the latest result
Script Preparation code:
const element = Array.from(Array(100000).keys())
Tests:
sort
element.sort((a,b) => a - b)
toSorted
const result = element.toSorted((a,b) => a - b)
sort reverse
element.sort((a,b) => b - a)
toSorted reverse
element.toSorted((a,b) => b - a)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
sort
toSorted
sort reverse
toSorted reverse
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
12 days ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0
Browser/OS:
Firefox 150 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
sort
471.1 Ops/sec
toSorted
495.8 Ops/sec
sort reverse
518.5 Ops/sec
toSorted reverse
327.8 Ops/sec
Related benchmarks:
Sort vs ToSorted
Math.max() vs .map().sort().reverse()
math.min/max vs sort
[...array].sort vs array.toSorted
array.toSorted vs array.sort
JavaScript .sort() vs .toSorted ()vs [...].sort()
array.sort vs array.toSortedxx
[...array].sort vs array.toSorted short array
[...array].sort vs [...array].toSorted
Comments
Confirm delete:
Do you really want to delete benchmark?