Haven-King / Atmosfera

A mod for Minecraft that adds atmospheric sounds
Apache License 2.0
26 stars 9 forks source link

Reduce memory allocations significantly #30

Closed Qendolin closed 2 years ago

Qendolin commented 2 years ago

Reduced dynamic memory allocation in Hemisphere.add and other places by ~50 MB/s (~90%).

Improvements:

Using ConcurrentHashMapreplaceAll() instead of clear() will keep all created Nodes around forever, but I don't think that'll be an issue since there are very few and they need little memory.

I've tested this somewhat, blockTags do seem to work but maybe I am missing something since I am not sure why the code was using TagDelegates in the first place. Also I did not find any use of biomeTags so I could not test it.

koelle25 commented 2 years ago

Does this fix/close #31 ?

Qendolin commented 2 years ago

No, but fixing that issue is very easy. I'll add some code to the issue.

EGOIST1372 commented 2 years ago

any update for the fix for #31 ?