DragonsPlusMinecraft / VisualityReforged

Little visual improvements by adding a bunch of new particles.
https://curseforge.com/minecraft/mc-mods/visuality-reforged
MIT License
4 stars 1 forks source link

BlockAmbientParticleConfig consumes significant portion of client CPU time #21

Open embeddedt opened 2 months ago

embeddedt commented 2 months ago

BlockAmbientParticleConfig.spawnParticles shows up pretty prominently in a profile of FTB NeoTech shortly after joining a world. The issue appears to be that the isAreaLoaded call is not that fast. I'd suggest reordering the checks here to check particles.containsKey(block) first; this is likely to be faster for the common case of no particles (especially on air) than calling isAreaLoaded for every single block. Also, is it even necessary to check if the area is loaded on a client?

embeddedt commented 2 months ago

By the way, I reported this here, rather than to the original Visuality, as I could not find the corresponding class in a quick check of their GitHub (even after accounting for package name differences).