Closed mjs closed 5 years ago
@mjs Why didn't you put dirty
notifier to TerminalState? Terminal and buffer share this object already. No need for extra argument in constructor.
@MaxRis I suggest we optimize this
@rrrooommmaaa will it be fine to add improvements as new separate PR?
@rrrooommmaaa I considered putting dirty
onto TerminalState but given that the dirty state was set for several conditions that don't involve a change to TerminalState it didn't seem like the right place for it.
I'm happy to revisit this later if you think it's worthwhile.
@mjs What conditions? Can you give examples, please?
Description
Instead of waking up regularly using WaitEventsTimeout, WaitEvents and PostEmptyEvent are used to make the main loop event driven. The maximum rate of redraws due to terminal activity can be tweaked via the new wakePeriod const.
This leads to some significant performance improvements: Aminal now consumes:
This change also incidentally fixes data races around the terminal dirty flag (which is now gone).
Type of change
How Has This Been Tested?
This has seen extensive manual testing on Windows and Linux using cmd.exe, Windows SSH to Linux host, zsh and bash on Linux.
Test Configuration:
Checklist: