Repository navigation
perf(rendering): reshape the keyboard overlay only when its text changes (2.8x faster) - #2525
Merged
richiemcilroy merged 3 commits intoOct 20, 2026
Conversation
Contributor
|
Someone is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
notkainoa
marked this pull request as ready for review
October 14, 2026 16:57
notkainoa
force-pushed
the
perf/keyboard-overlay-shape-cache
branch
from
October 14, 2026 19:34
2d71108 to
32eb6ca
Compare
Member
|
@greptileai review |
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.
The keyboard overlay is 2.8x cheaper per frame. It rebuilt and reshaped its text on every frame while keys were showing, even though the text only changes when a new key appears. Now it keeps the shaped text and reshapes only when it changes.
Runs on every frame of GPUI editor playback and export when the keyboard overlay is on.
What changed
default_color, which glyphon already uses for glyphs without their own color. Fades no longer force a reshape, and the pixels are the same.Output is unchanged
mainwith perf(rendering): reuse shaped text overlay layouts between frames (6.7-8.2x faster) #2524, perf(rendering): reshape the keyboard overlay only when its text changes (2.8x faster) #2525 and perf(rendering): reshape captions only when their text or style changes (up to 7.6x faster) #2526 applied together. Covers all 14 text animations, text styles, mid-playback edits, keyboard and caption styles, playback, backward scrubbing, random seeks, pauses and resizes. A planted cache-key bug makes thousands of frames differ, so the check catches mistakes.cargo test -p cap-rendering --release --lib: 305 passed on currentmain. The GPU tests pass with--include-ignored.cargo clippy -p cap-rendering --all-targets -- -D warningsandcargo fmtare clean.Benchmark setup
KeyboardLayer::prepareat 1920×1080: 3 typed commands at 60 fps. One warmup pass, then 3 measured passes pooled (466 visible frames per pass, 1,398 total). Each number is the median of 3 runs. Apple M1, release build, opt-level 3. "Before" is the same benchmark onmain(3d19c5c).CARGO_PROFILE_RELEASE_OPT_LEVEL=3 cargo test -p cap-rendering --release --lib benchmark_keyboard_layer_prepare -- --ignored --nocapture

Confidence Score: 5/5
The PR appears safe to merge; no blocking issue was found.Summary
KeyboardLayernow keeps shaped text until the text, font size, wrap width, family, or weight changes.The checkout lacked the previous review commit and a shared merge base. Review therefore covered the full endpoint diff.
Reviews (2) · Last reviewed commit: "test(rendering): check the keyboard layo..." · Reviewed by Greptile