Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Mac OS X 10.15.7
Desktop
8 months ago
Test name Executions per second
floor 3506336.8 Ops/sec
~~ 6393115.5 Ops/sec
>> 0 6383653.0 Ops/sec
| 0 6514622.0 Ops/sec
<< 0 6434581.5 Ops/sec
& 0xFFFFFFFFFFFF 6548028.0 Ops/sec
^ 0x000000000000 6524056.0 Ops/sec
Math.trunc() 3650447.8 Ops/sec
x - (x % 1) 4523510.0 Ops/sec
parseInt() 3671411.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;