Should mention, the sketch is a quick conversion of one I did earlier that does the picture viewer on to an ILI9341 display using conversion of my Teensy ILI9341_t3n library. It has DMA updates to the screen and the like...
I also ran that same sketch on the Portenta H7 board I have. The HAT carrier that I have for it, has the SDIO SD adapter. Arduino has their own library for this, performance was not great.
More details about that over on the thread:
The digitalWriteFast is a lot faster, although in this case may not matter much, Not doing that much changing of IO pins. But it also has the digitalToggleFast call which I like...
More details in the thread:
digitalWriteFast for GIGA? - Hardware / GIGA R1 - Arduino Forum