Skip to content

Optimize BlockInventoryMessage#56

Merged
Dream-Master merged 9 commits intomasterfrom
block-inv-fix
Apr 26, 2026
Merged

Optimize BlockInventoryMessage#56
Dream-Master merged 9 commits intomasterfrom
block-inv-fix

Conversation

@ABKQPO
Copy link
Copy Markdown
Member

@ABKQPO ABKQPO commented Feb 3, 2026

Refactor the Handler part, add missing null checks, and optimize the item merging from O(n²) to O(n) to reduce unnecessary performance overhead

@Nikolay-Sitnikov Nikolay-Sitnikov self-assigned this Feb 4, 2026
@Dream-Master Dream-Master added the 🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta label Feb 4, 2026
Comment thread src/main/java/net/dries007/holoInventory/network/BlockInventoryMessage.java Outdated
Comment thread src/main/java/net/dries007/holoInventory/network/BlockInventoryMessage.java Outdated
Comment thread src/main/java/net/dries007/holoInventory/network/BlockInventoryMessage.java Outdated
Copy link
Copy Markdown

@Luca-Guettinger Luca-Guettinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good direction, the O(n) merge is a clear improvement over the nested loop and the null safety fixes are needed. A few rough edges remain (the ones Nikolay flagged plus the loop condition and map type choice below).

Comment thread src/main/java/net/dries007/holoInventory/network/BlockInventoryMessage.java Outdated
@Luca-Guettinger Luca-Guettinger dismissed their stale review April 26, 2026 12:44

build fails

@Luca-Guettinger
Copy link
Copy Markdown

@ABKQPO okay so it seems that Object2LongOpenCustomHashMap is not avaliable at runtime, you probably need to revert that change then.

@Lyfts
Copy link
Copy Markdown
Member

Lyfts commented Apr 26, 2026

GTNHLib needs to be added as dependency

@Luca-Guettinger Luca-Guettinger self-requested a review April 26, 2026 13:02
@Dream-Master Dream-Master merged commit e17a416 into master Apr 26, 2026
1 check passed
@Dream-Master Dream-Master deleted the block-inv-fix branch April 26, 2026 13:03
@Dream-Master Dream-Master removed the 🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta label Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants