Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Linux
Desktop
one year ago
Test name Executions per second
floor 8033322.5 Ops/sec
~~ 12276581.0 Ops/sec
>> 0 12295055.0 Ops/sec
| 0 12271115.0 Ops/sec
<< 0 12138613.0 Ops/sec
& 0xFFFFFFFFFFFF 12263969.0 Ops/sec
^ 0x000000000000 12233507.0 Ops/sec
Math.trunc() 8034111.0 Ops/sec
x - (x % 1) 8233379.5 Ops/sec
parseInt() 7303233.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()