Run details:
Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126
Chrome OS 14541.0.0
Desktop
16 days ago
Test name Executions per second
floor 2719364.0 Ops/sec
~~ 2774302.2 Ops/sec
>> 0 2792073.2 Ops/sec
| 0 2838587.8 Ops/sec
<< 0 2816558.5 Ops/sec
& 0xFFFFFFFFFFFF 2794059.5 Ops/sec
^ 0x000000000000 2775452.0 Ops/sec
Math.trunc() 2730441.8 Ops/sec
x - (x % 1) 2662498.8 Ops/sec
parseInt() 2788351.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()