Skip to content

Improve MatterOpedia performance with client-side indexes - #111

Open
st0rm-kr wants to merge 7 commits into
Buuz135:1.21from
st0rm-kr:codex/matteropedia-client-indexes
Open

Improve MatterOpedia performance with client-side indexes#111
st0rm-kr wants to merge 7 commits into
Buuz135:1.21from
st0rm-kr:codex/matteropedia-client-indexes

Conversation

@st0rm-kr

@st0rm-kr st0rm-kr commented Aug 5, 2026

Copy link
Copy Markdown

Why

While playing ATM10 with a large item catalog, MatterOpedia performed very poorly. Opening the screen and changing filters could stall or freeze the client because each interaction repeatedly rebuilt item stacks, scanned the complete catalog, and sorted the full result set on the render thread.

What changed

  • Build one immutable client-side catalog after matter data is received.
  • Precompute per-matter amount and display-name indexes, including missing and single-matter views.
  • Use synchronous indexed queries, binary range lookup, and a bounded query cache instead of repeatedly filtering and sorting the full item list.
  • Create ItemStacks only for entries visible in the 7x9 viewport.
  • Rebuild name-dependent indexes after resource/language reloads and clear the catalog on logout.
  • Reuse the number formatter used by the render path.
  • Preserve existing empty matter query behavior.

This is client-side only and does not change packets, server calculation, or synchronization formats.

Validation

  • ./gradlew clean test build
  • 18 tests passed, 0 failures
  • Test JAR verified manually in ATM10 by the reporter

@st0rm-kr
st0rm-kr marked this pull request as ready for review August 5, 2026 15:11
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