perf: fastutil Long2ObjectOpenHashMap for PlayerMap, zero-allocation ConcurrentIntHashMap, and Java 9-25 timings support - #165
Open
GamingOP69 wants to merge 6 commits into
Conversation
…ConcurrentIntHashMap, and Java 9-25 timings support
GamingOP69
force-pushed
the
perf/playermap-and-timings-java-compat
branch
from
August 19, 2026 17:40
d4d5c5e to
6ad242a
Compare
Author
|
A few performance improvements and a Java compatibility fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Optimizes
PlayerMapspatial lookup performance, eliminates lambda allocations onConcurrentIntHashMap, synchronizes explosion density caching, fixes async pathfinding rejection recovery, and adds Java 9–25 version parsing support inCustomTimingsHandler.Problem & Root Cause
PlayerMapusedLong2ObjectArrayMap, which performsmove()beforeadd()causedNullPointerExceptionon uninitialized buckets.ConcurrentIntHashMapcreated unnecessary lambda instances on hot get/put paths in the entity tracker.explosionDensityCacheinWorld.javawas accessed without synchronization by async TNT calculations.SearchHandler.java, if the async pathfinding executor rejected a task (e.g. queue full),isSearchingwas never reset, permanently freezing mob navigation.CustomTimingsHandlerparsed Java versions assuming a single-digit major version format (1.8), which broke on modern Java runtimes (Java 9, 11, 17, 21, 25).Solution
PlayerMaptoLong2ObjectOpenHashMapformove().ConcurrentIntHashMapwith direct synchronized methods.explosionDensityCacheoperations.isSearchingcleanup on rejection.CustomTimingsHandlerto parse modern JRE version strings (11.0.x,17.0.x,21.0.x,25.x).PlayerMapRegressionTest,IndexedLinkedHashSetRegressionTest,ConcurrentIntHashMapRegressionTest,ExplosionDensityCacheConcurrencyTest,JavaVersionParsingTest, andJavaVersionParsingRegressionTest.