Skip to content

Keep built maps after load & dedupe updateLayout on first open#203

Draft
Rsslone wants to merge 2 commits into
CleanroomMC:cleanroomfrom
Rsslone:subtypePerf
Draft

Keep built maps after load & dedupe updateLayout on first open#203
Rsslone wants to merge 2 commits into
CleanroomMC:cleanroomfrom
Rsslone:subtypePerf

Conversation

@Rsslone
Copy link
Copy Markdown
Contributor

@Rsslone Rsslone commented May 11, 2026

As title states, not sure why the uid cache is reset after startup, maybe there is a good reason? idk.

Keep the maps that is generated on startup instead of clearing them, unless ultra low memory mode is enabled.
A simple bool to dedupe the updateLayout call on first open.

Fixes #202

@Rsslone
Copy link
Copy Markdown
Contributor Author

Rsslone commented May 11, 2026

Fixes #202

Copy link
Copy Markdown

@jchung01 jchung01 left a comment

Choose a reason for hiding this comment

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

StackHelper#uidCache is cleared after startup because it takes up a lot of memory. I verified this in the MeatballCraft modpack - with this PR, uidCache retains 473 MB. I think your 1st commit should be reverted, this seems unacceptable regardless of ultra-low memory mode.

Having no UID cache at runtime should be fine in most cases, it was only having performance issues with the anvil category because all possible itemstacks were being condensed into a single anvil entry per unique enchantment, so the LHS input and output ingredient lists were extremely large, causing the slowdown while querying the UID. As I mentioned in the issue, that only seems to be happening with the published version of 4.31.1 (for unknown reasons), but not one built off the current main branch.

open();
}
} finally {
openingGui = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this in a try-finally block?

open();
}
} finally {
openingGui = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this in a try-finally block?

@Rsslone Rsslone marked this pull request as draft May 12, 2026 23:03
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.

HEI category anvil lags

2 participants