(Almost) always invalidates full screen
Beginning with VTE 0.64, more precisely a57d145c, any change in the text contents causes the entire canvas to be invalidated and repainted.
(Might need to cherry-pick 069b68f3 and 89e9230d to compile those older versions on newer systems.)
meson -Ddebugg=true
ninja
VTE_DEBUG=updates ./src/app/vte-2.91
The difference in the red flashing is obvious. The new version prints this when a single letter is added to the canvas:
Invalidating rows -2147483647..2147483647 and context.
Invalidating rows 0..2147483647.
Invalidating all.
Draw (0,0)x(722,434)
The entire canvas is invalidated even if you're scrolled up way up in the scrollback buffer so that no portion of the mutable area is displayed.
If only the cursor moves then it's still only the cursor's old and new rows that are invalidated.
The commit log, as well as the debug messages don't suggest to me that this was an intentional change, I suspect it was not.
What should we do?
Since no one noticed the a performance regression for 3 years, conclude that we don't care and leave it as-is?
Go all in, do full screen repaints all the time, and clean up all the invalidation business logic in the code?
Or revert and fix this bug, because we do wish to improve performance as much as we reasonably can, and repainting 50-ish lines in a large terminal—even though most of the keypresses in the shell or in a text editor cause only a single line to change—is a huge unnecessary waste of resources?
(Honestly, I have no idea if the difference is notable or negligible in terms of speed / latency / perceived snappiness of the terminal, or in terms of laptop battery life.)