Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36
Chrome 95
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
floor 6064020.0 Ops/sec
~~ 11236287.0 Ops/sec
>> 0 11203620.0 Ops/sec
| 0 11188480.0 Ops/sec
<< 0 11146734.0 Ops/sec
& 0xFFFFFFFFFFFF 11191653.0 Ops/sec
^ 0x000000000000 11096991.0 Ops/sec
Math.trunc() 5916360.5 Ops/sec
x - (x % 1) 5586738.5 Ops/sec
parseInt() 6089293.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()