Repository navigation
perf(gpui): skip unused PCM preparation for GIF and cursor exports - #2569
Merged
richiemcilroy merged 6 commits intoOct 20, 2026
Merged
Conversation
Contributor
|
@EfeDurmaz16 is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
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.
A short GIF or cursor-only MOV currently decodes every microphone and system audio source into retained PCM, even though these formats export no audio. GPUI now uses an explicit video-only builder backed by the existing segment loader without audio. Metadata probing still preserves recording duration; generic and MP4 preparation retain audio.
On Apple M5 Pro, a four-second export selected from a synthetic 30-minute recording with two 48 kHz stereo AAC sources measured:
Three alternating pairs for each format and input length produced 24 complete exports. All 12 decoded-frame comparisons passed, including timestamps, durations and stream metadata. All six MOV comparisons additionally verify matching, visible moving alpha. The timer covers builder through encoder completion; configuration JSON loading and GPUI dialogs are excluded. Thirty-second controls show modest gains. These results are for the documented synthetic inputs, rather than a general export-speed claim.
Read order:
crates/export/src/lib.rs: explicit video-only preparation, retaining the existing generic/MP4 branches.apps/desktop-gpui/src/editor_export.rs: use it only for GIF and cursor MOV.apps/desktop-gpui/examples/video-only-preparation.rs: same-binary baseline/candidate benchmark with no new dependencies.scripts/prepare-video-only-export-fixture.py,scripts/check-video-only-export-parity.py, andscripts/test-video-only-export-parity.py: disposable inputs, decoded frame/alpha comparison, and checker regression tests.apps/desktop-gpui/docs/video-only-export-performance.md: reproduction commands, controls and all 24 raw samples.The handwritten production delta is 20 added and 3 removed lines. Reproduction scripts and a same-binary example include the raw measurements and parity checks. Alpha visibility validation reads fixed 64 KiB chunks and retains only extrema, avoiding full decoded-video buffering. No generated bindings change.
Validation already passed locally with the native dependencies configured:
python3 scripts/test-video-only-export-parity.py cargo +stable test --locked -p cap-export --lib cargo +stable check --manifest-path apps/desktop-gpui/Cargo.toml --locked --release -p cap-desktop-gpui --bin cap-gpui cargo +stable build --manifest-path apps/desktop-gpui/Cargo.toml --locked --release --example video-only-preparation cargo +stable clippy --manifest-path apps/desktop-gpui/Cargo.toml --locked --release --example video-only-preparation -- -D warnings cargo +stable fmt --all -- --check cargo +stable fmt --manifest-path apps/desktop-gpui/Cargo.toml --all -- --checkThe 42 export unit tests pass. Four checker regression tests also pass, covering bounded reads/retention on a virtual 6.22 GB logical stream, alpha edge cases, FFmpeg failure propagation, and decoder cleanup on read failure. The virtual stream tests bounded consumption without allocating or decoding a real 6.22 GB payload. The checked-in fixture/example/checker were also exercised end to end. No-audio preparation succeeds in both modes; corrupt display video fails in both. Existing output and extension-normalized output protection are verified.
Reviewer note: corrupt unused audio can now succeed after a metadata warning instead of failing the complete PCM decode. This is an intentional behavior change for formats that export no audio. Metadata probing remains. Native UI timing and cancellation were not measured.


Confidence Score: 5/5
The PR appears safe to merge; no actionable defects were found.Summary
GIF and cursor MOV exports now skip full audio decoding through
build_video_only. Generic and MP4 preparation keep their existing audio paths.Reviews (2) · Last reviewed commit: "Merge branch 'main' into perf/gpui-video..." · Reviewed by Greptile