Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0
Firefox 122
Windows
Desktop
10 months ago
Test name Executions per second
floor 255036784.0 Ops/sec
~~ 242708976.0 Ops/sec
>> 0 239781904.0 Ops/sec
| 0 239182880.0 Ops/sec
<< 0 240514288.0 Ops/sec
& 0xFFFFFFFFFFFF 237018288.0 Ops/sec
^ 0x000000000000 237428016.0 Ops/sec
Math.trunc() 240572944.0 Ops/sec
x - (x % 1) 1027123200.0 Ops/sec
parseInt() 238966096.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()