Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
Chrome 96
Windows
Desktop
2 years ago
Test name Executions per second
floor 1786995.9 Ops/sec
~~ 3328106.8 Ops/sec
>> 0 3060621.2 Ops/sec
| 0 3128170.8 Ops/sec
<< 0 3289008.0 Ops/sec
& 0xFFFFFFFFFFFF 2996321.2 Ops/sec
^ 0x000000000000 2975908.0 Ops/sec
Math.trunc() 1753729.8 Ops/sec
x - (x % 1) 2277200.5 Ops/sec
parseInt() 1833535.1 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;