Repository navigation
perf(first launch): asset extraction ~22 s → ~6 s on Windows - #217
Merged
Merged
Conversation
Use lexically_relative for the build-state manifest, skip the manifest in runtime-only mode, and delete the discarded editable tree in the background. Adds per-phase timing and TMC_EXTRACT_TIMING. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Result: a player's first launch, and the first launch after an extractor update, waits ~6 s instead of ~22 s on Windows. Release builds self-extract on first launch, so every player benefits. The extracted assets are unchanged.
Files:
port/port_asset_pipeline.cpp/.hpp,port/port_asset_log.cpp/.hpp,port/port_asset_bootstrap.cpp,tools/src/assets_extractor/assets_extractor_api.cpp/.hppCause
Extraction itself takes ~5.7 s. Most of the rest went to bookkeeping on the ~24k-file editable tree, which tmc_pc (
runtime_only) writes and then deletes:Change
BuildSourceStateuseslexically_relativeinstead ofstd::filesystem::relative. The latter resolves both paths on disk for every file, single-threaded, ~0.5 ms each on Windows. Paths are identical (verified: same 24,127-entry list).runtime_onlymode the build state records no source manifest (WriteBuildStateFile(..., listSources=false)). The tree is deleted right after, and with no editable tree the game already trusts the state file. A later editable tree triggers the same rebuild as today.Options::background_cleanup(set by tmc_pc): renameassets_src/<region>to<region>.deleting(instant) and delete it on a background thread. A leftover from an interrupted run is removed in the background at the next launch. The standalone extractor still deletes before returning, now in parallel.runtime_onlycomment said it skips writing the tree and "saves ~150 ms"; it writes then deletes it, so the comment now says that.TMC_EXTRACT_TIMING=1prints the top-level steps.Tested (Windows, USA)
Entering AgbMain.....deletingtree is removed at the next launch.asset_extractor --runtime-onlystill leaves no tree.Entering AgbMain....Developed with assistance from Claude Code (Opus 5.5). I reviewed and tested the changes as described above.