(Performance) Avoid reloading replays on every ghost picker interaction - #510
Open
KrishRVH wants to merge 1 commit into
Open
(Performance) Avoid reloading replays on every ghost picker interaction#510KrishRVH wants to merge 1 commit into
KrishRVH wants to merge 1 commit into
Conversation
KrishRVH
force-pushed
the
perf/cache-ghost-replay-picker
branch
from
July 26, 2026 09:11
e52f52a to
8db88da
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.
Selecting a replay or flipping perspective rebuilds the ghost picker overlay. That rebuild currently calls
load_all_replays()again, synchronously rescanning both replay directories, rereading and parsing logs, decoding JSONreplays, and sorting the merged list.
This change keeps the parsed list for one picker session. Preview and flip rebuilds reuse it; reopening the picker loads
a fresh snapshot. Back, Clear Replay, and Play Match release the cached list.
For
Npreview/flip interactions, replay loading drops fromN + 1complete passes to one.Verification
test_ghost_replay_picker_cache.lua, which checks one load per session and a fresh load after reopening.git diff --checkpass for the changed files.The existing
test_ruleset_shape.luaharness still fails before its assertions becauseCardAreais not stubbed; thatpath is unrelated to this change.