Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0
Firefox 110
Ubuntu
Desktop
one year ago
Test name Executions per second
floor 103051984.0 Ops/sec
~~ 140921264.0 Ops/sec
>> 0 205431392.0 Ops/sec
| 0 184603248.0 Ops/sec
<< 0 168533920.0 Ops/sec
& 0xFFFFFFFFFFFF 154593024.0 Ops/sec
^ 0x000000000000 161545008.0 Ops/sec
Math.trunc() 192196992.0 Ops/sec
x - (x % 1) 1107989248.0 Ops/sec
parseInt() 129346536.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;