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 135062048.0 Ops/sec
~~ 132002952.0 Ops/sec
>> 0 146003232.0 Ops/sec
| 0 148472208.0 Ops/sec
<< 0 144115760.0 Ops/sec
& 0xFFFFFFFFFFFF 146658944.0 Ops/sec
^ 0x000000000000 135777968.0 Ops/sec
Math.trunc() 138678432.0 Ops/sec
x - (x % 1) 919683200.0 Ops/sec
parseInt() 109140768.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()