Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0
Firefox 117
Linux
Desktop
one year ago
Test name Executions per second
floor 193379840.0 Ops/sec
~~ 193949504.0 Ops/sec
>> 0 193929632.0 Ops/sec
| 0 193975488.0 Ops/sec
<< 0 193655744.0 Ops/sec
& 0xFFFFFFFFFFFF 193625616.0 Ops/sec
^ 0x000000000000 193868368.0 Ops/sec
Math.trunc() 194172064.0 Ops/sec
x - (x % 1) 696341312.0 Ops/sec
parseInt() 193699152.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;