Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
sort sorted
(version: 1)
Comparing performance of:
sort vs toSorted
Created:
2 months ago
by:
Guest
Go to the latest result
Tests:
sort
const element = [{foo: 100}, {foo:200}, {foo: 50}, {foo: 20}, {foo: 90}] const result = [...element].sort((a,b) => a.foo - b.foo)
toSorted
const element = [{foo: 100}, {foo:200}, {foo: 50}, {foo: 20}, {foo: 90}] const result = element.toSorted((a,b) => a.foo - b.foo)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
sort
toSorted
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
Browser/OS:
Chrome 148 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
sort
9.6M/s
toSorted
9.4M/s
View exact numbers
Test name
Executions per second
✓
sort
9,575,441 Ops/sec
toSorted
9,442,792 Ops/sec
Related benchmarks
Sort vs ToSorted
[...array].sort vs array.toSorted
Sort vs ToSorted 222
[...array].sort vs array.toSorted short array
array.sort vs array.toSorted (2)
[...array].sort vs [...array].toSorted
Sort vs ToSorted 100k
Comments
Confirm delete:
Do you really want to delete benchmark?