WeaponMechanics / MechanicsMain

A New Age of Weapons in Minecraft.
https://www.spigotmc.org/resources/WeaponMechanics.99913/
MIT License
80 stars 27 forks source link

Faster Configuration #395

Open CJCrafter opened 7 months ago

CJCrafter commented 7 months ago

Create a new config system that separates by data type, and uses a "fast lib" for primitives (Or we implement our own, similar to DoubleMap).

Online comparisons suggest that getting types may take $\frac 1 6^{th}$ the time, which is not even considering that hash collisions could be reduced by having multiple maps. This would also take less memory, since we wouldn't have to use java's wrapper classes for primitives, which take >3x the data. Unfortunately, this isn't the biggest improvement since we already use serializers to "condense" objects. For example, block damage config gets condensed into BlockDamage, which doesn't use primitive wrappers.

CJCrafter commented 5 months ago

https://github.com/WeaponMechanics/MechanicsMain/compare/master...primitive-config