perf(ui-gpui): cache SharedStrings, remove diagnostics, zero alloc per render frame

This commit is contained in:
Hibryda 2026-03-19 09:38:00 +01:00
parent b557aeb833
commit 5dbf5bd43c
3 changed files with 44 additions and 69 deletions

View file

@ -60,15 +60,9 @@ impl Workspace {
}
}
static WORKSPACE_RENDERS: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0);
impl Render for Workspace {
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
let wc = WORKSPACE_RENDERS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
if wc % 10 == 0 {
eprintln!("[Workspace] render #{wc}");
}
// Don't read app_state in render — it subscribes and causes re-renders on every tick
// Hardcoded layout state — avoids model subscription that causes re-renders
let sidebar_open = true;
let settings_open = false;
let palette_open = false;