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
9 months ago
Test name Executions per second
floor 4069666.8 Ops/sec
~~ 7522234.5 Ops/sec
>> 0 7612913.5 Ops/sec
| 0 7536417.5 Ops/sec
<< 0 7511050.0 Ops/sec
& 0xFFFFFFFFFFFF 7515831.5 Ops/sec
^ 0x000000000000 7594777.0 Ops/sec
Math.trunc() 4091329.0 Ops/sec
x - (x % 1) 4872197.5 Ops/sec
parseInt() 3898527.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;