Repository navigation
Cache chat tab-line descriptors - #316
Merged
ericdallo merged 2 commits intoSep 14, 2026
Merged
Conversation
Reuse stable tab-line descriptor data between redisplay calls and invalidate it when chat metadata, loading, approval, registry, or session state changes. Add focused tab-line cache tests for the update paths and cleanup paths.
Add a focused benchmark for chat tab-line redisplay costs and clean up tab-line cache test advice so later tests see unmodified edit commands.
plux
force-pushed
the
hn/chat-tab-line-cache
branch
from
September 12, 2026 18:51
ae62875 to
65d284e
Compare
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.
Description
ECA chat tab-line rendering rebuilt stable tab descriptors during redisplay.
That work repeated title formatting, activity checks, and session chat traversal for every redraw.
With many open chats, tab-line updates spent increasing time on data that only changes when chat state changes.
This PR caches stable tab descriptors per session.
It keeps per-redisplay selection state outside the cache.
Changes
selectedstate out of the stable cache so each buffer renders the correct active tab.benchmarks/eca-chat-tab-line-bench.elfor focused tab-line timing and profiler runs.Benchmarks
Measured
benchmarks/eca-chat-tab-line-bench.elwith synthetic chat buffers on Emacs 30.1.Each chat had 20 turns.
Each result uses the median from 3 runs.
tabs-warmtabs-warmtab-face-alltab-face-allThe normal warm tab-list path improved by
8.14xat 50 chats.The tab face workload improved by
5.11xat 50 chats.The forced rebuild path is slower after this change because that benchmark invalidates the cache before every call.
That row measures worst-case invalidation cost, not normal redisplay.
The intended path keeps stable tab descriptors cached between redisplays.