Repository navigation
Fewer memory allocations every frame - #102
Merged
Merged
Conversation
|
LGTM 👍 The reused submission and barrier arrays are cleared before reuse, preserving semaphore order, image layouts, and ownership transfers. The menu compares the incoming view with the displayed one before swapping them, and |
seaweeduk
force-pushed
the
perf/fewer-frame-allocations
branch
from
November 22, 2026 20:14
1a58b8e to
585cce4
Compare
seaweeduk
force-pushed
the
refactor/wave-5
branch
2 times, most recently
from
November 22, 2026 20:59
53e2f9e to
e635c6a
Compare
seaweeduk
force-pushed
the
perf/fewer-frame-allocations
branch
from
November 22, 2026 20:59
585cce4 to
b996cce
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.
During playback, median main-thread allocations fell from 52–79 per frame to 12–13 across two clips, with the menu open and closed.
vkQueueSubmitfrom one frame to the next (GpuContext::FrameSlot,GpuContext::submit). The submission order is unchanged.GlInteropandDirectVideokeep their barrier lists, andGlInterop::publishkeeps its texture lists and compactsinGl_in place.Menu::nextView()), andupdateMenufills it in place.update(nextView())swaps it withview_instead of copying it, so the strings and lists in both views keep their capacity. Every field is still set every frame.serversSetUpwas the only field built up with|=, soStashCommands::fillnow resets it first.Menu::updatecompares tracks field by field, where it used to build two signature strings.StashPages::updatecompares the write-back status the same way, where it used to build a status string.isPhotoFile(five calls per frame) andhasPackedAlpha(two) no longer copy the file name or make anstd::filesystem::pathfrom it. They give the same answers as before.Autofocus::updatecompares its content key without building it first. The console's pixel path line is written into a string thatSettledLinekeeps, and it is still printed only after it has stayed the same for a second.Allocations per frame
Main thread, median per frame between
xrWaitFramecalls, counted with anLD_PRELOADmalloc counter. Measured on the desktop under Monado at 120 Hz with 1024 px eyes, about 470 frames with the menu closed and 340 with it open.The Stash write-back comparison only runs with a server set up, and the direct video barriers only run on the Steam Frame, so neither appears in these numbers.
Frame time on the Steam Frame
Main-thread time per frame outside
xrWaitFrame, median [min, max] of two launches per build, alternating, at 120 Hz with 3780 px eyes. It was lower on every clip, but within the run-to-run spread, so this is less work per frame rather than a measured speedup. Both builds: every launch at 120 fps, no dropped frames.Known and left as is
isPhotoFile()takes astd::stringorstd::filesystem::path. All callers already supply one of those types; passing a bare string literal would be ambiguous.sameTracks()checks the same fields as the old track signature. A codec-only change on an unselected track still doesn't trigger a dropdown redraw by itself.Important
AI disclosure
anthropic/claude-opus-5-5highopenai/gpt-6.2-astrahighAgent harness OpenCode 2.3.2