Conversation
Author
|
non-MT version - #616 |
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.
Short version
Made using AI (GPT 5.6 Sol)
The engine was loading many unrelated things one after another.
This PR runs independent native loading work in parallel. Work that is unsafe to parallelize—Lua, object spawning, renderer publication, and D3D11 immediate-context calls—still runs in the original order on the owner thread.
The main target is the MT DX11/R4 build, especially large modpacks such as GAMMA.
What this changes
Faster level loading
R4 can now prepare several level components at the same time:
Worker threads read and prepare data. Unsafe renderer state is still committed on the main/render thread.
A process-local static level cache also avoids rebuilding unchanged level data when possible.
Faster startup
The startup path now does less repeated filesystem work:
-prefetch_sounds;There is no permanent generated cache. Changed mods and files are detected normally on the next launch.
Cheaper precache
All 60 logical precache frames still happen, so frame callbacks and Lua-visible state are preserved.
Only expensive world rendering is reduced:
Render->Calculate(), frame updates, callbacks, loading-screen rendering and the final world render are preserved.Load-session diagnostics
The engine now records the complete load session and its major parts:
This is more useful than the old
total loading time, which covers only part of the real loading process.What this does not change
This PR does not:
restart_all,on_registeror script binders;net_Spawnin parallel;In simple terms: native data preparation is parallel, but game-visible publication remains ordered.
Results
Tested on Ryzen 7 9800X3D and SATA SSD
These are single comparable runs on the same machine, not medians.
The level-loading comparisons use the existing
total loading timelog value.Vanilla Anomaly 1.5.3
GAMMA
Startup to main menu
The largest improvements appear in GAMMA new-game loading, new-level transitions and startup. Hot save is mostly limited by sequential Lua/ALife work and therefore improves much less.
Testing performed
The DX11-AVX x64 MT build was tested with:
The implementation also includes fixes for races found during testing in:
Scope and limitations