Reduce agent spinner GPU usage#51756
Conversation
Anthony-Eid
left a comment
There was a problem hiding this comment.
UI is slightly changed here
| .child(SpinnerLabel::sand().size(LabelSize::Small)), | ||
| .justify_center() | ||
| .child(self.generating_spinner.clone()), |
There was a problem hiding this comment.
This would change the confirmation spinner from rendering with the sand animation to the default. I don't think this is what we want here
cc: @danilo-leal For additional feedback if you have any
|
@Anthony-Eid can you re-review? Waiting for my fan not to spin up anymore, annoying my colleagues :D |
|
Going to review this later today! Sorry for the delay |
|
@AndPuQing can you run cargo fmt? |
done |
|
@Anthony-Eid could you restart the workflow? :) |
|
@Anthony-Eid sorry for bothering you, but a little reminder for when you have a time. This is pretty important to me (and my laptop's battery) Thank you in advance |
|
0001-Use-window.use_state-to-clean-up-code.patch @AndPuQing Could you please apply this patch to your PR? I tried checking out and pushing to your branch manually but I didn't have permission too. |
|
@AndPuQing Sorry, is there anyway you could give me permission to make an edit directly on your branch? I want to fix the merge conflicts. Also, my patch was incomplete, we shouldn't be passing any of the entities for the spinners around.
|
I have enabled "Allow edits by maintainer" and I have also invited you to join my forked collaborator group. |
|
It is released! TY! :) |
Yes, but we can still do better. Next week I'm going to see what else I can do to improve gpu usage in the agent panel because that's still high |
|
Awesome! Yes on Linux I still have up to 30% GPU usage just from the agent panel. |
Closes zed-industries#39532 ## Summary Move the long-running agent "generating" spinner into a dedicated `GeneratingSpinner` view. Previously, the generating state rendered `SpinnerLabel` inline as part of the full thread view. This change keeps the same spinner styling, but isolates it into its own small view so the animation no longer needs to live directly inside the larger thread UI subtree while the agent is running. before: <img width="398" height="448" alt="image" src="https://github.com/user-attachments/assets/8a56c394-f7a6-4835-b877-fbc1500d2d03" /> after: <img width="524" height="597" alt="image" src="https://github.com/user-attachments/assets/bd2e5804-dba8-49c0-a421-7dc5ba600348" /> ## Testing - `cargo run -j 4 ~/Downloads/WorkSpace/zed/` - `cargo check -p agent_ui` Release Notes: - Fixed high GPU usage from the agent panel's generating spinner while an agent is running. --------- Co-authored-by: Anthony Eid <[email protected]>


Closes #39532
Summary
Move the long-running agent "generating" spinner into a dedicated
GeneratingSpinnerview.Previously, the generating state rendered
SpinnerLabelinline as part of the full thread view. This change keeps the same spinner styling, but isolates it into its own small view so the animation no longer needs to live directly inside the larger thread UI subtree while the agent is running.before:
after:
Testing
cargo run -j 4 ~/Downloads/WorkSpace/zed/cargo check -p agent_uiRelease Notes: