Run details:
Mozilla/5.0 (Android 13; Mobile; rv:107.0) Gecko/107.0 Firefox/107.0
Firefox Mobile 107
Android
Mobile
2 years ago
Test name Executions per second
floor 687615488.0 Ops/sec
~~ 690546880.0 Ops/sec
>> 0 686395648.0 Ops/sec
| 0 689280256.0 Ops/sec
<< 0 688117696.0 Ops/sec
& 0xFFFFFFFFFFFF 685529856.0 Ops/sec
^ 0x000000000000 683761344.0 Ops/sec
Math.trunc() 670548160.0 Ops/sec
x - (x % 1) 731935488.0 Ops/sec
parseInt() 52704808.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()