Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109
Linux
Desktop
one year ago
Test name Executions per second
floor 3090235.8 Ops/sec
~~ 5742202.5 Ops/sec
>> 0 5799948.5 Ops/sec
| 0 5790150.0 Ops/sec
<< 0 5862193.5 Ops/sec
& 0xFFFFFFFFFFFF 5877853.5 Ops/sec
^ 0x000000000000 5938854.5 Ops/sec
Math.trunc() 3150232.8 Ops/sec
x - (x % 1) 3774438.5 Ops/sec
parseInt() 3139645.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;