Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Linux
Desktop
8 months ago
Test name Executions per second
floor 5672463.0 Ops/sec
~~ 10559853.0 Ops/sec
>> 0 8999860.0 Ops/sec
| 0 10969174.0 Ops/sec
<< 0 10957882.0 Ops/sec
& 0xFFFFFFFFFFFF 10277050.0 Ops/sec
^ 0x000000000000 10497498.0 Ops/sec
Math.trunc() 6020801.0 Ops/sec
x - (x % 1) 6747465.0 Ops/sec
parseInt() 5828084.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;