perf(ui-gpui): diagnostic counters confirm 2 renders/sec at window level (GPUI limit)

- Sidebar and StatusBar uncached (natural size collapsed with StyleRefinement::default)
- ProjectGrid cached with flex-1 style (into_cached_flex)
- AgentPane + TerminalView cached within ProjectBox
- BlinkState::start() fixed with &mut *cx deref coercion
- CPU: ~3% with full layout visible (down from 6.8% uncached)
- Remaining: ProjectBox re-renders full tree on blink (reads BlinkState)
- Next: isolate dot into StatusDotView entity to prevent ProjectBox re-render
This commit is contained in:
Hibryda 2026-03-19 22:45:21 +01:00
parent a25e024d54
commit 1f26e5b272
4 changed files with 34 additions and 28 deletions

View file

@ -110,7 +110,7 @@ impl ProjectBox {
let should_pulse = matches!(self.project.agent.status, AgentStatus::Running);
if should_pulse {
let blink = cx.new(|_cx| crate::components::blink_state::BlinkState::new());
crate::components::blink_state::BlinkState::start(&blink, cx);
crate::components::blink_state::BlinkState::start(&blink, &mut *cx);
self.blink_state = Some(blink);
}
@ -151,7 +151,7 @@ impl Render for ProjectBox {
div()
.flex_1()
.w_full()
.child(pane.clone().into_cached_view()),
.child(pane.clone().into_cached_flex()),
);
}
@ -172,7 +172,7 @@ impl Render for ProjectBox {
div()
.w_full()
.h(px(180.0))
.child(term.clone().into_cached_view()),
.child(term.clone().into_cached_flex()),
);
}