Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124
Linux
Desktop
7 months ago
Test name Executions per second
floor 4162604.0 Ops/sec
~~ 7709683.0 Ops/sec
>> 0 7487305.5 Ops/sec
| 0 7456233.0 Ops/sec
<< 0 7539577.0 Ops/sec
& 0xFFFFFFFFFFFF 7483718.5 Ops/sec
^ 0x000000000000 7512769.5 Ops/sec
Math.trunc() 4176434.8 Ops/sec
x - (x % 1) 5086984.0 Ops/sec
parseInt() 4102259.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()