lithium-fabric icon indicating copy to clipboard operation
lithium-fabric copied to clipboard

cache blockstates and blast resistance for explosions

Open pwouik opened this issue 4 years ago • 4 comments

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

pwouik avatar Oct 06 '21 18:10 pwouik

more accurate times:7.3s vs 10.0s

pwouik avatar Oct 06 '21 21:10 pwouik

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

pwouik avatar Oct 07 '21 13:10 pwouik

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.

2No2Name avatar Oct 29 '21 16:10 2No2Name

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

pwouik avatar Oct 29 '21 22:10 pwouik