Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Firefox 91
Linux
Desktop
2 years ago
Test name Executions per second
floor 441560352.0 Ops/sec
~~ 441851904.0 Ops/sec
>> 0 440937600.0 Ops/sec
| 0 442474112.0 Ops/sec
<< 0 443250848.0 Ops/sec
& 0xFFFFFFFFFFFF 436027616.0 Ops/sec
^ 0x000000000000 442973312.0 Ops/sec
Math.trunc() 441054496.0 Ops/sec
x - (x % 1) 442836480.0 Ops/sec
parseInt() 14787762.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()