Skip to content

Fix O(n²) item cramp check and cache per-cycle display names - #152

Open
wling-art wants to merge 1 commit into
LOOHP:masterfrom
wling-art:perf/item-display-holder-name-cramp-fix
Open

Fix O(n²) item cramp check and cache per-cycle display names#152
wling-art wants to merge 1 commit into
LOOHP:masterfrom
wling-art:perf/item-display-holder-name-cramp-fix

Conversation

@wling-art

Copy link
Copy Markdown
  • isCramping scanned every item entity against every other item entity in the world each update cycle. Bucket items by block position once per cycle so it only scans the 3x3x3 neighbourhood.
  • getDisplayName() was recomputed (NMS -> JSON -> Adventure) for every item entity every cycle, even when many entities shared an identical stack (e.g. mob farm drops). Cache results in a map scoped to a single update cycle, discarded afterwards.

@wling-art
wling-art force-pushed the perf/item-display-holder-name-cramp-fix branch from ad690b0 to 937f8dd Compare August 17, 2026 07:48
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.

1 participant