Terminal::draw() performance improvement
This is tested against the older renderer still (GSK_RENDERER=gl
) because lots of optimizations are still landing in NGL.
But, this should be unaffected by that and help everywhere, including GTK 3.
Basically, when scrolling with vim (ctrl+f/ctrl+b) it looks like we hit Terminal::determine_colors()
very hard. These patches fix that up by 1) culling some API @chpe already found is unnecessary (worth 2.8% !) and then fixing some branch prediction (worth 2%), and then hoisting a cell_is_selected_log() (worth 1.5%).
The next big offenders to try to optimize further would be BidiRow::vis2log()
(around 5%) and RingView::get_bidirow()
(around 7%).
0001-terminal-remove-determine_colors-invisible-check.patch
0002-terminal-annotate-unlikely-paths-in-determine_colors.patch