Script Preparation code:
AخA
 
var objs = [ 
    { first_nom: 'Lazslo', last_nom: 'Jamf'     , pid: 4},
    { first_nom: 'Pig',    last_nom: 'Bodine'   , pid: 7},
    { first_nom: 'Pirate', last_nom: 'Prentice' , pid: 1}
];
Tests:
  • Logical

     
    objs.sort((a,b) => (a.pid > b.pid) ? 1 : -1);
  • Math Minus

     
    objs.sort((a,b) => (a.pid - b.pid));
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Logical
    Math Minus

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
Chrome 86 on Windows 7
View result in a separate tab
Test name Executions per second
Logical 1107322.0 Ops/sec
Math Minus 1171948.5 Ops/sec