Valkyrie Skies 2 + dynamic assets problems
cfitz25 opened this issue ยท 3 comments
Bug Description
When Valkyrie Skies and ModernFix is installed with mixin.perf.dynamic_resources=true enabled then loading/creating a world it hangs at 0% for a while. The CPU usage seems to be 100% but only on 1 core/thread.
I think its to do with Valkyrie Skies generating weight for different blocks so loading everything at once on the main thread.
I dont know if there is much you can do when a mod needs to load everything before a world loads. Would it be possible to somehow offload that task to another thread?
Reproduction Steps
- Install ModernFix
- Add mixin.perf.dynamic_resources=true to ModernFix config
- Install Valkyrie Skies
- May need more blocks to show effect more severely install Create, Supplementaries, BetterEnd, BetterNether, etc
- Generate/Open a world
Log File
It happens aftet "We are not using UDP, falling back to TCP" for each of these.
latest-took-too-long.log
latest-only-moderfix-valkyrie.log
latest-long-but-finished.log
I'm not able to reproduce this behavior. I tried to install Create + Supplementaries + VS2 on Forge, and enable dynamic resources. I do not see any extra loading that takes long enough for it to be visible in my profiling tools.
Moreover, I enabled the -Dmodernfix.debugDynamicModelLoading=true JVM option, which logs messages whenever a model is loaded or baked. There are no messages printed after the We are not using UDP, falling back to TCP log message until the world is fully loaded, at which point models load normally for chunk rendering as usual. So I suspect either there is another mod besides VS installed that is loading all the models during world load, or VS is accessing model manager internals in a way that bypasses the debug option's ability to report the loading (although in the latter case, I would still expect to see it in my profiler).
I dont know if there is much you can do when a mod needs to load everything before a world loads. Would it be possible to somehow offload that task to another thread?
That's not something I can solve on my end. The loading is being driven by the other mod and I just provide the models as requested, so that type of design change needs to be made on their end. In general my recommendation is for mods to compute data like that lazily (i.e. the first time it's needed for any given block), as this naturally works with dynamic resources, and is usually faster even without it especially if the computations take a while.
I forgot to say i am using fabric but I found the issue, it seems More Culling was going through every block/blockstate before any thing else could load.
If this is removed then no baking is done before world load.
It must have been getting worse the whole time but Valkyrie must have just been when i noticed it.
I see More Culling has come up before for assuming things models are loaded early too #328 (comment)
Ah, yes. There's unfortunately not much I can do to improve that; it's a tradeoff between launch performance and in-game rendering performance (although in my personal experience, More Culling's blockstate culling alone doesn't provide that huge of a speed boost over vanilla). There might be an option to turn off that feature while keeping the rest of the culling changes enabled.