Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
Chrome 112
Linux
Desktop
one year ago
Test name Executions per second
floor 2459646.8 Ops/sec
~~ 4601968.5 Ops/sec
>> 0 4608293.0 Ops/sec
| 0 4652282.5 Ops/sec
<< 0 4667817.5 Ops/sec
& 0xFFFFFFFFFFFF 4641979.0 Ops/sec
^ 0x000000000000 4560922.5 Ops/sec
Math.trunc() 2593189.2 Ops/sec
x - (x % 1) 3085606.8 Ops/sec
parseInt() 2509492.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()