Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Chrome Mobile 131
Android
Mobile
one month ago
Test name Executions per second
floor 3179312.0 Ops/sec
~~ 4485141.0 Ops/sec
>> 0 4461919.5 Ops/sec
| 0 4445438.5 Ops/sec
<< 0 4457368.5 Ops/sec
& 0xFFFFFFFFFFFF 4423437.5 Ops/sec
^ 0x000000000000 4422493.0 Ops/sec
Math.trunc() 3119708.2 Ops/sec
x - (x % 1) 2625681.0 Ops/sec
parseInt() 3118834.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()