Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Chrome 135
Mac OS X 10.15.7
Desktop
one year ago
Benchmark.js
sort
4.8M/s
manual compare
3.1M/s
localcompare
2.3M/s
date convert to timestamp + sort (timezone safe)
425K/s
date convert to date + sort a-b (timezone safe)
276K/s
View exact numbers
Test name Executions per second
sort 4,820,234 Ops/sec
manual compare 3,062,006 Ops/sec
localcompare 2,321,690 Ops/sec
date convert to timestamp + sort (timezone safe) 424,519 Ops/sec
date convert to date + sort a-b (timezone safe) 275,729 Ops/sec
Script Preparation code:
Tests: