Script Preparation code:
AخA
 
var arr = new Array(10000).fill(0).map(() => Math.random() * 10);
Tests:
  • Right shift

     
    arr.map(n => n >> 1);
  • Divide and floor

     
    arr.map(n => Math.floor(n / 2));
  • Divide and floor 2

     
    arr.map(n => ~~(n / 2));
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Right shift
    Divide and floor
    Divide and floor 2

    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/94.0.4606.71 Safari/537.36
Chrome 94 on Linux
View result in a separate tab
Test name Executions per second
Right shift 14431.3 Ops/sec
Divide and floor 644.0 Ops/sec
Divide and floor 2 11045.2 Ops/sec