Sort

Benchmark created on


Setup

const data = [{name:'beta'},{name:'zeta'},{name:'delta'},{name:'gamma'}];

Test runner

Ready to run.

Testing in
TestOps/sec
localeCompare
data.sort((a, b) => a.name.localeCompare(b.name));
ready
if
data.sort((a, b) => {if(a.name <= b.name){return -1;}else{return 1;}});
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.