With two monitors, gnome-shell spends 70% of its (real)time blocked in meta_monitor_manager_kms_wait_for_flip
With two monitors, gnome-shell spends 70% of its (real)time blocked in meta_monitor_manager_kms_wait_for_flip.
Actually this isn't surprising. I could tell it was going to happen when browsing the code. The problem is that with two separate displays they're never going to be in phase with each other. Even if they're the same frequency you could spend most of your time waiting for the condition of zero flips pending. Or 50% on average. The attached realtime profile from Google profiler shows my system is spending 70% of its real time blocked in meta_monitor_manager_kms_wait_for_flip.
I expect this bug explains multiple previous bug reports people have made about multi-monitor performance in Wayland sessions. Particularly when a busy or dragged window overlaps multiple monitors.
Fun fact: We used to have a similar bug in Mir, but it was easier to fix there with threading.