Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Chrome 129
Linux
Desktop
2 months ago
Test name Executions per second
floor 4323862.0 Ops/sec
~~ 8310155.0 Ops/sec
>> 0 8241342.5 Ops/sec
| 0 8133896.5 Ops/sec
<< 0 8182611.5 Ops/sec
& 0xFFFFFFFFFFFF 8332197.5 Ops/sec
^ 0x000000000000 8352509.5 Ops/sec
Math.trunc() 4285497.5 Ops/sec
x - (x % 1) 5400770.5 Ops/sec
parseInt() 4286563.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()