Hoist vteunistr hot path into calling functions
The two most hot paths for vteunistr
from the Ring
perspective come from vte::base::Ring::freeze_row()
in the form of _vte_unistr_append_to_string()
and _vte_unistr_strlen()
.
Both of these have an overwhelmingly simple path and then a slower, more expensive decomposition path.
A couple quick patches later and we've a combined reduction of more than 5% CPU savings.
- 0001-unistr-hoist-g_string_append_unichar-into-caller.patch
- 0002-unistr-hoist-_vte_unistr_strlen-into-caller.patch
It might also make sense to add a "this is a single ascii byte so use g_string_append_c()
" case since that can be inlined on modern GLib, but these two patches should be less controversial.