Script Preparation code:
x
 
function getRandomInt(max) {
  return Math.floor(Math.random() * Math.floor(max));
}
var arr = [];
for(var i = 0; i < 100000; i++){
  arr.push([-1,getRandomInt(100)]);
}
Tests:
  • map & sort

     
    arr.map(r => r[1]).sort()
  • sort & map

     
    arr.sort((a,b) => a[1]-b[1]).map(r => r[1])
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    map & sort
    sort & map

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0
Chrome 133 on Windows
View result in a separate tab
Test name Executions per second
map & sort 66.5 Ops/sec
sort & map 188.2 Ops/sec