Fast Tag
Modby nutant233
Optimize performance related to tags
Description
In vanilla MC, TagKey objects are deduplicated upon creation through an Interner, so no multiple identical objects exist (allowing identity comparison via identityHashCode and ==). However, since TagKey is a record class, it automatically generates hashCode and equals methods that compare the internal registry and location, and the Interner relies on these for deduplication. This makes hashCode and equals calls elsewhere slower compared to identity comparison. This mod replaces the Interner with a custom deduplicator and overrides the record-generated hashCode and equals, using identityHashCode and == instead, greatly improving comparison and lookup performance elsewhere while also slightly speeding up creation. Incidentally, ResourceKey has also been switched to this custom deduplicator, improving creation speed and reducing memory usage.
Which areas can be optimized: Tags are used in various places throughout MC, such as items, blocks, fluids, entities, world generation, etc., and they all perform checks on whether they contain a certain tag.
Recommended Gear
AffiliateHardware and extras that pair well with this mod.
As an Amazon Associate I earn from qualifying purchases.
Similar Mods
Pop!
Simple mod that adds the unused bubble popping particle and sound
Custom Pets
Make your own Custom Pets! Dynamic and Real Time!
Zombie Nightmare Expansions - Undead Horror Monsters
Adds various creepy undead entities with unique mechanics and intricate designs
Coin of Flight
A coin that enables flight
EnchantedShulkers
Adds some helpful enchantments for Shulker Boxes
Screencopy
Let's you copy screenshot to clipboard