Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Chrome 113
Linux
Desktop
one year ago
Test name Executions per second
floor 4818466.5 Ops/sec
~~ 9139930.0 Ops/sec
>> 0 9169447.0 Ops/sec
| 0 9087617.0 Ops/sec
<< 0 9134212.0 Ops/sec
& 0xFFFFFFFFFFFF 9215871.0 Ops/sec
^ 0x000000000000 9212456.0 Ops/sec
Math.trunc() 4791121.5 Ops/sec
x - (x % 1) 5741228.5 Ops/sec
parseInt() 4764818.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;