Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Chrome 129
Linux
Desktop
2 months ago
Test name Executions per second
floor 4298893.5 Ops/sec
~~ 8327972.0 Ops/sec
>> 0 8234328.0 Ops/sec
| 0 8344074.5 Ops/sec
<< 0 8116135.0 Ops/sec
& 0xFFFFFFFFFFFF 8303378.0 Ops/sec
^ 0x000000000000 8225243.5 Ops/sec
Math.trunc() 4356027.5 Ops/sec
x - (x % 1) 5310599.5 Ops/sec
parseInt() 4293741.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()