Run details:
Mozilla/5.0 (Android 12; Mobile; rv:109.0) Gecko/110.0 Firefox/110.0
Firefox Mobile 110
Android
Mobile
one year ago
Test name Executions per second
floor 412601792.0 Ops/sec
~~ 415706592.0 Ops/sec
>> 0 414128928.0 Ops/sec
| 0 410668736.0 Ops/sec
<< 0 413392032.0 Ops/sec
& 0xFFFFFFFFFFFF 410693568.0 Ops/sec
^ 0x000000000000 413821216.0 Ops/sec
Math.trunc() 421862528.0 Ops/sec
x - (x % 1) 453463648.0 Ops/sec
parseInt() 14145515.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()