chunky
chunky copied to clipboard
Legacy map view optimisations
Closes #1074 The main thing here is that the first 4096 blocks in any block palette are now legacy blocks Those blocks can also be used by non-legacy chunks if their tag matches (thanks redox)
Palettes are created once per RegionParser thread now, instead of once per chunk
I also tweaked the load factor of the palette hashmap to somewhat avoid expensive collisions, given ~33000 blocks in the palette, the overhead is ~0.5MiB per palette
I've tested 1.12, 1.15, 1.17, 1.18, 1.12CuC, and all appear to be working fine
erm, this test (DeadlockTest) does not fail on my machine, did it time out?
Nothing I've changed here should mess with that at all
@leMaik is it possible to trigger a rebuild without me pushing a dummy commit?
Looks good, I also restarted the action. :+1:
The failing build makes no sense, that test is for the renderer, and doesn't interact with loading in any way
maybe it's just timing out...? should I increase the timeout...
Somehow it fails consistently, though. Do the tests fail locally, too? I don't even know if the test actually tests for the bug it used to test for anymore.
No they do not fail locally
Profiling the deadlock test, it seems like a significant amount of time is spent creating the new buffered scene in DefaultRenderManager and initializing the block palette. On master the time spent creating the scene is much, much smaller.
I see, the test is creating a LOT of scene objects. I'll push a simple solution, one moment
turns out having null blocks in the palette would modify the save format, which is not something I would like to do I'll see if I can think of a nice solution
I suppose I could add an unknown block there actually
This branch actually fails to load this world created in Chunky 2.5.0-46-g937a3539.
1148 test.zip
Exception in thread "Scene Manager" java.lang.NullPointerException
at se.llbit.chunky.chunk.BlockPalette.applyMaterial(BlockPalette.java:244)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at se.llbit.chunky.chunk.BlockPalette.applyMaterials(BlockPalette.java:255)
at se.llbit.chunky.renderer.scene.Scene.loadOctree(Scene.java:2218)
at se.llbit.chunky.renderer.scene.Scene.loadScene(Scene.java:613)
at se.llbit.chunky.renderer.scene.SynchronousSceneManager.loadScene(SynchronousSceneManager.java:150)
at se.llbit.chunky.renderer.scene.AsynchronousSceneManager.lambda$loadScene$0(AsynchronousSceneManager.java:104)
at se.llbit.chunky.renderer.scene.AsynchronousSceneManager.run(AsynchronousSceneManager.java:80)
yes that is what this is referring to https://github.com/chunky-dev/chunky/pull/1148#issuecomment-1023051668