You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by as...@apache.org on 2026/09/23 17:34:50 UTC
(maka) branch feat/desktop-gpui-spike updated: perf(desktop): stop per-frame repaints while streaming
This is an automated email from the ASF dual-hosted git repository.
Astro-Han pushed a commit to branch feat/desktop-gpui-spike
in repository https://gitbox.apache.org/repos/asf/maka.git
The following commit(s) were added to refs/heads/feat/desktop-gpui-spike by this push:
new 944051bdcc perf(desktop): stop per-frame repaints while streaming
944051bdcc is described below
commit 944051bdccb17c5f033d4c073a1ff65c822f2a26
Author: AstroHan <le...@outlook.com>
AuthorDate: Thu Sep 24 01:34:45 2026 +0800
perf(desktop): stop per-frame repaints while streaming
TextView's stream fade asks for a new animation frame on every display
refresh while text keeps growing, so a focused window repainted at the
display rate for the whole reply. On a 17 s mock reply the client spent
about 6.2 s of CPU (~34% of a core) with the fade and 1.15 s (~6%)
without it.
The notification pump now waits 100 ms instead of 40 ms between
batches. With the fade gone this is the remaining knob: 40 ms measured
about 9% on the same reply, 100 ms about 6%.
Generated-by: Claude Code
---
crates/desktop/src/chat.rs | 5 +----
crates/desktop/src/workspace.rs | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/crates/desktop/src/chat.rs b/crates/desktop/src/chat.rs
index 371d368cb3..c2bf51e9e7 100644
--- a/crates/desktop/src/chat.rs
+++ b/crates/desktop/src/chat.rs
@@ -539,10 +539,7 @@ impl Chat {
)
.into_any_element(),
Kind::Assistant => match self.markdown.get(&item.key) {
- Some((state, _)) => TextView::new(state)
- .selectable(true)
- .stream_fade(true)
- .into_any_element(),
+ Some((state, _)) => TextView::new(state).selectable(true).into_any_element(),
None => div().child(item.text.clone()).into_any_element(),
},
Kind::Thinking => div()
diff --git a/crates/desktop/src/workspace.rs b/crates/desktop/src/workspace.rs
index 8ed530bcf2..11c24bd669 100644
--- a/crates/desktop/src/workspace.rs
+++ b/crates/desktop/src/workspace.rs
@@ -38,7 +38,7 @@ use std::{path::PathBuf, time::Duration};
use tokio::sync::mpsc;
/// Deltas arrive at the provider's chunk rate; one repaint per window is enough.
-const STREAM_FRAME: Duration = Duration::from_millis(40);
+const STREAM_FRAME: Duration = Duration::from_millis(100);
enum Connection {
Connecting,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org