Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Mobile/15E148 Safari/604.1
Mobile Safari 16
iOS 16.1.2
Mobile
one year ago
Test name Executions per second
floor 5755829.0 Ops/sec
~~ 8344972.5 Ops/sec
>> 0 9133308.0 Ops/sec
| 0 9045462.0 Ops/sec
<< 0 7237988.5 Ops/sec
& 0xFFFFFFFFFFFF 9118636.0 Ops/sec
^ 0x000000000000 8929345.0 Ops/sec
Math.trunc() 5470936.5 Ops/sec
x - (x % 1) 5179965.5 Ops/sec
parseInt() 4570700.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;