Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.167 YaBrowser/22.7.3.799 Yowser/2.5 Safari/537.36
Yandex Browser 22
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
floor 5689872.0 Ops/sec
~~ 10828425.0 Ops/sec
>> 0 10816045.0 Ops/sec
| 0 10816863.0 Ops/sec
<< 0 10810699.0 Ops/sec
& 0xFFFFFFFFFFFF 10822970.0 Ops/sec
^ 0x000000000000 10828327.0 Ops/sec
Math.trunc() 5696050.0 Ops/sec
x - (x % 1) 5663549.0 Ops/sec
parseInt() 5729240.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;