Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0
Firefox 122
Windows
Desktop
10 months ago
Test name Executions per second
floor 237267408.0 Ops/sec
~~ 240526912.0 Ops/sec
>> 0 245494928.0 Ops/sec
| 0 239451840.0 Ops/sec
<< 0 246820368.0 Ops/sec
& 0xFFFFFFFFFFFF 240979904.0 Ops/sec
^ 0x000000000000 236056384.0 Ops/sec
Math.trunc() 243044784.0 Ops/sec
x - (x % 1) 1011378880.0 Ops/sec
parseInt() 239586352.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()