Reduce memory operations when mouse pointer is within widget
Currently, if you have a lot of screen updates and the mouse pointer is within the widget, a good deal of extra processing must occur around hyperlink_hilite_update()
and match_hilite_update()
.
These patches combined shave off a little over 4% CPU by reusing a GString
for m_match_contents
and a VteCharAttrList
instead of GArray
for the m_match_attributes
.
0001-vteinternal-use-specialized-array-for-char-attribute.patch
0002-terminal-require-caller-to-allocate-GString-for-get_.patch
There are two more things that might be useful in the long term, if anyone cares to work on it:
- Reusing allocations in
bidi.cc
forBidiRunner::implicit_paragraph()
might be another 2.5% savings. -
create_match_context()
could use a custom general context with simple bump allocator. Re-using those pages across frames is likely enough and would be at least 2% more off CPU.