Tests:
  • sorting an array and then reverse

    AخA
     
    const arr = [ 83, 52, 100, 58, 20, 41, 53, 19, 27, 60, 91, 2, 29, 78, 45, 49, 56, 98, 35, 66, 63, 79, 3, 61, 75, 59, 71, 65, 34, 1, 81, 74, 30, 5, 97, 57, 62, 31, 92, 43, 16, 55, 32, 8, 46, 68, 40, 12, 87, 82, 80, 54, 96, 14, 94, 88, 72, 67, 24, 85, 76, 15, 18, 17, 64, 11, 51, 25, 38, 21, 48, 28, 39, 7, 89, 33, 26, 73, 90, 95, 36, 10, 47, 6, 69, 22, 4, 86, 44, 9, 93, 37, 84, 42, 99, 23, 77, 13, 70, 50];
    const case1 = [...arr].sort( (a,b) => a - b).reverse();
  • sorting with reversive comparison

     
    const arr = [ 83, 52, 100, 58, 20, 41, 53, 19, 27, 60, 91, 2, 29, 78, 45, 49, 56, 98, 35, 66, 63, 79, 3, 61, 75, 59, 71, 65, 34, 1, 81, 74, 30, 5, 97, 57, 62, 31, 92, 43, 16, 55, 32, 8, 46, 68, 40, 12, 87, 82, 80, 54, 96, 14, 94, 88, 72, 67, 24, 85, 76, 15, 18, 17, 64, 11, 51, 25, 38, 21, 48, 28, 39, 7, 89, 33, 26, 73, 90, 95, 36, 10, 47, 6, 69, 22, 4, 86, 44, 9, 93, 37, 84, 42, 99, 23, 77, 13, 70, 50];
    const case2 = [...arr].sort( (a,b) => b - a);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    sorting an array and then reverse
    sorting with reversive comparison

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 17 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Chrome 133 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
sorting an array and then reverse 290203.2 Ops/sec
sorting with reversive comparison 305000.0 Ops/sec