Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36
Chrome 91
Windows
Desktop
3 years ago
Test name Executions per second
floor 3131358.0 Ops/sec
~~ 5733205.0 Ops/sec
>> 0 5765151.0 Ops/sec
| 0 5920438.5 Ops/sec
<< 0 5662047.0 Ops/sec
& 0xFFFFFFFFFFFF 5602149.5 Ops/sec
^ 0x000000000000 5627079.0 Ops/sec
Math.trunc() 2989937.8 Ops/sec
x - (x % 1) 3847314.0 Ops/sec
parseInt() 2910460.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;