Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Linux
Desktop
one month ago
Test name Executions per second
floor 3095590.2 Ops/sec
~~ 4453608.5 Ops/sec
>> 0 4503583.5 Ops/sec
| 0 4412662.0 Ops/sec
<< 0 3966522.0 Ops/sec
& 0xFFFFFFFFFFFF 3823300.0 Ops/sec
^ 0x000000000000 3770647.2 Ops/sec
Math.trunc() 2746183.8 Ops/sec
x - (x % 1) 2601081.8 Ops/sec
parseInt() 2704245.8 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()