Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0
Firefox 106
Linux
Desktop
2 years ago
Test name Executions per second
floor 260200128.0 Ops/sec
~~ 246764432.0 Ops/sec
>> 0 252339328.0 Ops/sec
| 0 246788784.0 Ops/sec
<< 0 245046192.0 Ops/sec
& 0xFFFFFFFFFFFF 255616944.0 Ops/sec
^ 0x000000000000 258713936.0 Ops/sec
Math.trunc() 262853920.0 Ops/sec
x - (x % 1) 805953152.0 Ops/sec
parseInt() 31859276.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;