Run details:
Mozilla/5.0 (X11; CrOS x86_64 15054.98.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Chrome 106
Chrome OS 15054.98.0
Desktop
2 years ago
Test name Executions per second
floor 1446559.1 Ops/sec
~~ 3010054.2 Ops/sec
>> 0 3036320.5 Ops/sec
| 0 3070202.8 Ops/sec
<< 0 3071566.5 Ops/sec
& 0xFFFFFFFFFFFF 3094745.5 Ops/sec
^ 0x000000000000 3074939.5 Ops/sec
Math.trunc() 1493162.0 Ops/sec
x - (x % 1) 1979053.2 Ops/sec
parseInt() 1513009.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()