GPUI (both 1 and 2) currently performs rendering, layout, and painting at the end of every effect cycle. This leads to poor performance when the app receives events more frequently than the display refreshes. Such rapid events can come from a terminal, an LSP, or a mouse with a high polling rate. This PR changes GPUI so that we don't render until the OS notifies us that the content will be presented, via the `displayLayer:` callback. Because render, layout, and paint have side effects that are sometimes relied on in tests, we currently keep the old behavior (drawing after every effects cycle) in tests. This is similar to what @ForLoveOfCats explored in https://github.com/zed-industries/zed/pull/3542, but slightly simpler, in that we're not using the display link. As a follow-up, we could use the display link to start rendering earlier, to possibly reduce latency further.
7 files changedLine totals unavailable