Repository navigation
perf(gpui): stream the editor preview into one texture (default on Linux) - #2854
Draft
richiemcilroy wants to merge 4 commits into
Draft
richiemcilroy wants to merge 4 commits into
richiemcilroy wants to merge 4 commits into
Conversation
…ure behind CAP_GPUI_STREAMING_IMAGE
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…Windows has an in-app A/B
This branch was successfully deployed
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.
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Stacked on #2852 (phase 2 of the gpui streaming-image design). Moves the editor preview's RGBA path to a
StreamingImage. It is on by default on Linux, and opt-in on Windows and for macOS's RGBA fallback.Change
EditorPreviewFrame::Stream(StreamingImage). The editor pump keeps one Rgba8 stream per editor instance.frame_arrived's update closure hands it to the stream on the main thread. This happens after theholds_instancecheck, so a stale pump can't change what the preview shows.Arc.frame_image)drop_imageof the previous frame: the window's dead-stream sweep releases the texture nowconvert_nanos/convert_samples, so the bench counters stay comparable.Kill switch
CAP_GPUI_STREAMING_IMAGE:0: back to per-frameRenderImages1: opts Windows and macOS's RGBA fallback inWindows is off by default because no CI runner could run the in-app A/B there (see below).
Tests
In-app editor A/B
CI scratch branch
ci/streaming-editor-ab, run 39670701971..capwith mic, generated withcap_verify::fixture.CAP_GPUI_AUTO_EDITOR=<fixture> CAP_GPUI_AUTO_TIMELINE_BENCH=1 CAP_GPUI_MUTE_AUDIO=1.CAP_GPUI_STREAMING_IMAGE=0/1interleaved (order alternating per round), 3 rounds, medians.timed_draw(paint) per framePumpStatsconvert avgPumpStats.presentedgpu_specsconfirms the passes ran on lavapipe Vulkan and llvmpipe GL 4.5.Linux lavapipe (Vulkan)
Linux llvmpipe (GL)
cleanhas no preview frames; its differences are noise.An earlier version wrote wgpu stream frames during paint. On GL that made draw p50 12–24% worse, while main-thread CPU was already lower. #2852 now defers that write to
before_frame, where the atlas uploads happen, and the tables above are from after that change.Windows
The in-app A/B could not run on any available CI runner:
The Windows evidence is therefore the D3D11 WARP atlas micro-benchmark in #2852: 1.2–2.1x faster, flat at 1080p, 0 large allocations per frame. That's why Windows is opt-in until the A/B runs on a real Windows machine.
Atlas micro-benchmark
See #2852. On Linux, wgpu on lavapipe Vulkan / llvmpipe GL makes the atlas step 1.4–3.8x faster at p50. Textures created per 600 frames drop from 600 to 1, and large allocations per frame drop from 2 to 0.