Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36
Chrome 92
Linux
Desktop
3 years ago
Test name Executions per second
floor 2134659.5 Ops/sec
~~ 3963133.8 Ops/sec
>> 0 3779686.8 Ops/sec
| 0 4195063.5 Ops/sec
<< 0 3933663.2 Ops/sec
& 0xFFFFFFFFFFFF 3923420.8 Ops/sec
^ 0x000000000000 4017438.2 Ops/sec
Math.trunc() 2039647.5 Ops/sec
x - (x % 1) 2213778.2 Ops/sec
parseInt() 1935838.9 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;