Script Preparation code:
AخA
 
var arrs = Array(1000).fill(0).map(x => Array(1000).fill(0).map(x => Math.random()))
Tests:
  • Normal Sort

     
    for (var arr of arrs) {
      arr.sort((a, b) => a - b);
    }
  • Reuse function

     
    var sortFunc = (a, b) => a - b;
    for (var arr of arrs) {
      arr.sort(sortFunc);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Normal Sort
    Reuse function

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
Chrome 84 on Mac OS X 10.15.6
View result in a separate tab
Test name Executions per second
Normal Sort 42.5 Ops/sec
Reuse function 41.9 Ops/sec