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 2570425.5 Ops/sec
~~ 4751845.0 Ops/sec
>> 0 4787501.0 Ops/sec
| 0 4751659.0 Ops/sec
<< 0 4794208.0 Ops/sec
& 0xFFFFFFFFFFFF 4697551.0 Ops/sec
^ 0x000000000000 4609778.5 Ops/sec
Math.trunc() 2523755.0 Ops/sec
x - (x % 1) 3036051.8 Ops/sec
parseInt() 2553415.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;