Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Windows
Desktop
9 months ago
Test name Executions per second
floor 2694152.8 Ops/sec
~~ 4635465.5 Ops/sec
>> 0 4598032.0 Ops/sec
| 0 4328447.5 Ops/sec
<< 0 4413501.0 Ops/sec
& 0xFFFFFFFFFFFF 4476744.0 Ops/sec
^ 0x000000000000 4190569.2 Ops/sec
Math.trunc() 2337188.8 Ops/sec
x - (x % 1) 2588852.0 Ops/sec
parseInt() 2271663.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;