Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0
Firefox 85
Linux
Desktop
3 years ago
Test name Executions per second
floor 331280800.0 Ops/sec
~~ 356400352.0 Ops/sec
>> 0 368920608.0 Ops/sec
| 0 356277920.0 Ops/sec
<< 0 318913024.0 Ops/sec
& 0xFFFFFFFFFFFF 363858624.0 Ops/sec
^ 0x000000000000 351538496.0 Ops/sec
Math.trunc() 344258048.0 Ops/sec
x - (x % 1) 358869600.0 Ops/sec
parseInt() 20083034.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()