perf(render): reduce per-frame allocations in panel and pointer hot paths#165
Open
perf(render): reduce per-frame allocations in panel and pointer hot paths#165
Conversation
…aths Defer the Vec<Event> clone in handle_terminal_pointer_input past the early-exit check so panels not under the pointer skip the clone entirely. Remove title and display_title String fields from PanelSnapshot — the display title is now computed inline via Cow (often zero-alloc), and the panel title is fetched lazily only during the rare rename interaction. Replace the per-frame Vec<(WorkspaceId, String, Color32)> with a reusable Vec<(WorkspaceId, Color32)> field; workspace names are looked up lazily inside the context-menu callback which only runs when the menu is open. Store panel_render_order as a reusable field to avoid a Vec allocation every frame. Trim tokio to features = ["rt", "macros"] (transitive deps supply the rest) and add panic = "abort" to the release profile.
peters
commented
Apr 15, 2026
Owner
Author
peters
left a comment
There was a problem hiding this comment.
Left one inline comment on the release-profile change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Vec<Event>cloning inhandle_terminal_pointer_inputuntil cheap pointer-hit checks show the panel actually needs pointer processingStringcloningrtandmacros; transitive dependencies still provide the IO and network features used by the update pathsHorizonApp::newbootstrap setup into a helper after mergingmain, keeping the constructor within clippy limits without changing behaviorReview follow-up
maininto this branch to resolve the PR conflictpanic = "abort"changeTest plan
cargo fmt --all -- --check./scripts/check-maintainability.shRUSTFLAGS="-D warnings" cargo test --workspacecargo clippy --all-targets --all-features -- -D warningscargo clippy --workspace --lib --bins --examples -- -D warnings -D clippy::unwrap_used -D clippy::expect_usedcargo clippy --workspace --all-targets --all-features -- -D warnings -W clippy::pedantic