1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 05:12:40 +03:00

term: compress rows as they move into scrollback

This commit causes lines to be "compressed" (really, just translated
to the new clustered line storage variant) as they move into scrollback.

The memory savings are significant for large scrollback:

`wezterm -n --config scrollback_lines=1000000`

`time cat enwiki8.wiki`

before: ~9s, Resident: 2.1G
after: ~15s, Resident: 620K (!)

The performance impact is non-trivial, and I will dig into that
next.

refs: https://github.com/wez/wezterm/issues/1626
This commit is contained in:
Wez Furlong 2022-07-23 13:01:48 -07:00
parent c8b1b92e08
commit 751dd460da

View File

@ -645,6 +645,12 @@ impl Screen {
}
};
if scroll_region.start == 0 {
for y in self.phys_range(&(0..num_rows as VisibleRowIndex)) {
self.line_mut(y).compress_for_scrollback();
}
}
let remove_idx = if scroll_region.start == 0 {
0
} else {