Dedupe updateLayout on first open#203
Conversation
|
Fixes #202 |
jchung01
left a comment
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
To ensure it always gets set back to false, is it actually a concern? I don't know.
| open(); | ||
| } | ||
| } finally { | ||
| openingGui = false; |
There was a problem hiding this comment.
To ensure it always gets set back to false, is it actually a concern? I don't know.
I agree, this might have been me following a red herring, it makes sense why I was struggling to find the cause now. I'll leave this as a draft until I can revert that commit so it doesn't merged. |
A simple bool to dedupe the updateLayout call on open.
EDIT : This PR has been rewritten to remove the very flawed red herring I cased trying to fix an issue.