Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0
Firefox 121
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
floor 708621376.0 Ops/sec
~~ 711341568.0 Ops/sec
>> 0 710273024.0 Ops/sec
| 0 707148992.0 Ops/sec
<< 0 712164992.0 Ops/sec
& 0xFFFFFFFFFFFF 710580416.0 Ops/sec
^ 0x000000000000 712732032.0 Ops/sec
Math.trunc() 711838144.0 Ops/sec
x - (x % 1) 750387392.0 Ops/sec
parseInt() 713280768.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()