Add bounded artifact cache hot paths for large-airport open#53
Open
EnJiang wants to merge 4 commits into
Open
Conversation
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.
Why
Opening very large airports can spend a long time in first-screen setup because WED repeatedly re-parses OBJ/AGP resources, re-decodes textures, and reparses Navaid reference data even when those inputs have not changed.
In our local testing on a representative large airport package (ZGSZ), the source-backed path was a 20+ wating process everytime. The goal of this PR is to keep the existing synchronous loading model, but avoid doing the same expensive work again on warm reopens.
How
This PR adds a bounded on-disk artifact cache for WED resource hot paths.
What is cached:
.objtext.glCompressedTexImage2Dinstead of paying driver-side on-the-fly compression again.earth_nav.dat/atc.dat/apt.datwhen the Navaid overlay is visible.Storage model:
Important behavior notes:
User Interface
This PR adds a new top-level
Performancemenu with:Cache Artifact(persistent toggle, default on)Clear Artifact CacheSo users who do not want the cache can disable it, and users can explicitly clear the on-disk artifacts.
Measurements
Representative local measurements on ZGSZ:
6.3 s1.7-1.8 s0.49 sto about0.009 son warm hitIn short: this PR is aimed at large-airport reopen performance, and in our local measurements it moved the hot first-screen path from 20+ seconds down to about two seconds without changing WED's synchronous loading semantics.
Validation
Local validation performed on Windows: