lithium-fabric
lithium-fabric copied to clipboard
cache blockstates and blast resistance for explosions
cache all blockstates and blast resistance in a hashmap Modify a lot the structure, and is probably not very clean 7.6s vs 13.1s in normal lithium:1000 tnt at 0 10 0 not very precise,I got many differents result,but it seems to be significantly faster
original idea to cache origin blocks in array by sarah
more accurate times:7.3s vs 10.0s
profiling:not big improvement,like 2~3% of the explosion https://spark.lucko.me/LTFgWbJX4m cached https://spark.lucko.me/CGFectP9mr not cached my previous test was probably not accurate
Caching the inner 3x3x3 or 5x5x5 might be a good idea. I think it is not viable to cache all blocks in the explosion range, as the outer ones will not be hit by many explosion rays, making the caching less effective.
iirc it wasn't better, and more complex,but I will not be able to test in the next days here is the 5x5x5 code I manage to recover(not 100% sure it work directly) ExplosionMixin.txt