It would be a good idea to implement a patch similar to Pop!_OS where they patched GNOME Shell to have a realtime priority (SCHED_RR | SCHED_RESET_ON_FORK) for the compositor process.
In particular when asked how to implement this in other desktop environments, they responded: "You'd need to repackage your DE with a post install script that runs setcap CAP_SYS_NICE=+ep $PATH_TO_BIN, and a patch to the code that uses sched.h to set the process to realtime at the lowest priority."
It would be a good idea to implement a patch similar to Pop!_OS where they patched GNOME Shell to have a realtime priority (SCHED_RR | SCHED_RESET_ON_FORK) for the compositor process.
Note this comment: https://www.reddit.com/r/linux/comments/bwhy7k/linux_needs_realtime_cpu_priority_and_a_universal/epy44lm/
In particular when asked how to implement this in other desktop environments, they responded: "You'd need to repackage your DE with a post install script that runs setcap CAP_SYS_NICE=+ep $PATH_TO_BIN, and a patch to the code that uses sched.h to set the process to realtime at the lowest priority."