Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Firefox 115
Windows
Desktop
one year ago
Test name Executions per second
floor 136851488.0 Ops/sec
~~ 138797248.0 Ops/sec
>> 0 139727344.0 Ops/sec
| 0 139558528.0 Ops/sec
<< 0 139202304.0 Ops/sec
& 0xFFFFFFFFFFFF 139841904.0 Ops/sec
^ 0x000000000000 139630016.0 Ops/sec
Math.trunc() 130048160.0 Ops/sec
x - (x % 1) 225568864.0 Ops/sec
parseInt() 129164504.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()