Keeping Latency under control - lathoub/Arduino-AppleMIDI-Library GitHub Wiki
To have latency visible in the MacOS MIDI Network Setup, make sure the TimestampRtpPackets is set to true in the AppleMIDI_Settings.h
Wi-Fi
This library will run on WIFI hardware (WIFI Shield or ESP32 Wifi), but when low latency is needed, go for wired Ethernet.
Latency in the MacOS MIDI Network Setup on an ESP32:

Ethernet
ESP32 & W5500
Wired Ethernet is better to reduce latency. Here is the same ESP32, but using an W5500:

The latency is very close to 0ms.
SAMD
SAMD21 has low latency using the W5500

ATMEGA
A slower ATMEGA2560 has a fixed latency around 3 ms.

(All above measurements done using the Ethernet3 library with an W5500 chip)