diff options
author | Aram Drevekenin <aram@poor.dev> | 2022-11-21 20:07:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 20:07:24 +0100 |
commit | 63e7531c48f1c8fbe916e3ac5475cf36201f52b8 (patch) | |
tree | 534e56cf9cf2924cec94a32bef1b6bcf92760209 /zellij-server | |
parent | 5ad0429adc3bbb33b2578d3e699f2e61d6d0b940 (diff) |
performance(rendering): improve rendering performance (#1960)
* refactor(plugins): plugins now need to explicitly ask to be rendered
* performance(render): remove various needless renders
* performance(render): cache boundaries
* performance(render): adjust tests and cache cursor location/shape
* style(comment): remove outdated
* style(fmt): rustfmt
Diffstat (limited to 'zellij-server')
72 files changed, 646 insertions, 747 deletions
diff --git a/zellij-server/src/output/mod.rs b/zellij-server/src/output/mod.rs index f40c8514e..51a21f7b4 100644 --- a/zellij-server/src/output/mod.rs +++ b/zellij-server/src/output/mod.rs @@ -396,6 +396,12 @@ impl Output { } Ok(serialized_render_instructions) } + pub fn is_dirty(&self) -> bool { + !self.pre_vte_instructions.is_empty() + || !self.post_vte_instructions.is_empty() + || self.client_character_chunks.values().any(|c| !c.is_empty()) + || self.sixel_chunks.values().any(|c| !c.is_empty()) + } } // this struct represents the geometry of a group of floating panes diff --git a/zellij-server/src/panes/grid.rs b/zellij-server/src/panes/grid.rs index 0bc2b7671..b3ee85a44 100644 --- a/zellij-server/src/panes/grid.rs +++ b/zellij-server/src/panes/grid.rs @@ -1081,11 +1081,14 @@ impl Grid { pub fn reset_viewport(&mut self) { let max_lines_to_scroll = *SCROLL_BUFFER_SIZE.get().unwrap() * 2; // while not very elegant, this can prevent minor bugs from becoming showstoppers by sticking the whole app display in an endless loop let mut lines_scrolled = 0; + let should_clear_output_buffer = self.is_scrolled; while self.is_scrolled && lines_scrolled < max_lines_to_scroll { self.scroll_down_one_line(); lines_scrolled += 1; } - self.output_buffer.update_all_lines(); + if should_clear_output_buffer { + self.output_buffer.update_all_lines(); + } } pub fn rotate_scroll_region_up(&mut self, count: usize) { if let Some((scroll_region_top, scroll_region_bottom)) = self diff --git a/zellij-server/src/panes/tiled_panes/mod.rs b/zellij-server/src/panes/tiled_panes/mod.rs index cc4e95e6d..96fd2f67d 100644 --- a/zellij-server/src/panes/tiled_panes/mod.rs +++ b/zellij-server/src/panes/tiled_panes/mod.rs @@ -65,6 +65,8 @@ pub struct TiledPanes { fullscreen_is_active: bool, os_api: Box<dyn ServerOsApi>, senders: ThreadSenders, + window_title: Option<String>, + client_id_to_boundaries: HashMap<ClientId, Boundaries>, } impl TiledPanes { @@ -100,6 +102,8 @@ impl TiledPanes { fullscreen_is_active: false, os_api, senders, + window_title: None, + client_id_to_boundaries: HashMap::new(), } |