Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36
Chrome Mobile 118
Android
Mobile
one year ago
Test name Executions per second
floor 2793121.5 Ops/sec
~~ 5342718.5 Ops/sec
>> 0 5359805.5 Ops/sec
| 0 5362144.5 Ops/sec
<< 0 5362760.5 Ops/sec
& 0xFFFFFFFFFFFF 5385022.0 Ops/sec
^ 0x000000000000 5370515.0 Ops/sec
Math.trunc() 2788278.0 Ops/sec
x - (x % 1) 3207342.5 Ops/sec
parseInt() 2814120.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()