Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Chrome 110
Linux
Desktop
one year ago
Test name Executions per second
floor 3987196.5 Ops/sec
~~ 7412930.5 Ops/sec
>> 0 7539056.0 Ops/sec
| 0 7527513.0 Ops/sec
<< 0 7329918.0 Ops/sec
& 0xFFFFFFFFFFFF 7516067.0 Ops/sec
^ 0x000000000000 7451481.0 Ops/sec
Math.trunc() 3951002.8 Ops/sec
x - (x % 1) 4792904.5 Ops/sec
parseInt() 3950469.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()