Script Preparation code:
x
 
var a1 = 148423134.4;
var a2 = -462841;
var a3 = 0;
var customAbs= function(input){
  return (input + (input >> 31)) ^ (input >> 31);
}
Tests:
  • Math

     
    Math.abs(a1);
    Math.abs(a2);
    Math.abs(a3);
  • custom

     
    customAbs(a1);
    customAbs(a2);
    customAbs(a3);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Math
    custom

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36
Chrome 93 on Linux
View result in a separate tab
Test name Executions per second
Math 1534127.4 Ops/sec
custom 2119148.2 Ops/sec