Do you have to use that Arduino?
A PIC with a configurable logic cell module such as a 16F18323 or 16F18446 can pretty much read an encoder in hardware.
Or some of the more powerful DSPIC or PIC24 MC version devices have dedicated quadrature input modules.
eg.
That has a quadrature interface with 32 bit position register; see section 17 of the data sheet.
The DSPIC or PIC24 are also far better for driving graphics displays - that one has 256K flash and 32K RAM, with a 16 bit CPU.
Or, if you want to stick with the Arduino IDE, I've used an ESP32 devkit C with this library in one gadget:
A Quadrature and half quadrature PCNT peripheral driven encoder library supporting 8 encoders - madhephaestus/ESP32Encoder
That uses some of the hardware peripherals; I only used it for a digital pot style encoder so no idea how well it works.
For the 16F18323 or other PICs that have the CLC module, it needs a few lines to configure it, then just the count increment in one interrupt routine and the decrement in the other.