Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0
Firefox 106
Mac OS X 10.15
Desktop
2 years ago
Test name Executions per second
floor 995112384.0 Ops/sec
~~ 989402496.0 Ops/sec
>> 0 990749632.0 Ops/sec
| 0 989582464.0 Ops/sec
<< 0 993501696.0 Ops/sec
& 0xFFFFFFFFFFFF 987640960.0 Ops/sec
^ 0x000000000000 984450624.0 Ops/sec
Math.trunc() 1001314688.0 Ops/sec
x - (x % 1) 1039660288.0 Ops/sec
parseInt() 31403042.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()