Run details:
Mozilla/5.0 (Android 12; Mobile; rv:104.0) Gecko/104.0 Firefox/104.0
Firefox Mobile 104
Android
Mobile
2 years ago
Test name Executions per second
floor 911171776.0 Ops/sec
~~ 917433152.0 Ops/sec
>> 0 915367744.0 Ops/sec
| 0 915289088.0 Ops/sec
<< 0 915339584.0 Ops/sec
& 0xFFFFFFFFFFFF 902130304.0 Ops/sec
^ 0x000000000000 918593024.0 Ops/sec
Math.trunc() 903580864.0 Ops/sec
x - (x % 1) 910932480.0 Ops/sec
parseInt() 32920994.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()