Unification Optimization
pitbox46 opened this issue ยท 0 comments
Cross-mod Integration
No response
Feature Description
Hello, I am working on an overall performance optimization mod for the ATM9 modpack. I have noticed a significant amount of startup time (approximately 100 seconds on my machine) is devoted to getUnificationEntry. This function also makes tooltips take much longer to render.
There seems to be lots of inefficiencies. For instance, computeIfAbsent
does not distinguish between no current value and the current value is null
. Because of that, each item that should have no UnificationEntry
has to painstakingly loop through each entry every time the function is called.
Also, I can't find any reason why the computed map can't be all computed at once. Here is my mixin which rewrites the function. With this, I got the total time spent on the function (during world loading) down to 0.04 seconds which obviously an incredible increase. Overall world load times fell from 260sec to 210sec.
I am weary that there may have been a reason the function was written the way it was, and I may have broken something through doing this. However, everything in game seems to work perfectly fine from my limited testing.
Please feel free to ask me questions
EDIT: I see that this was solved in an extremely recent commit! A bit unlucky for me since I was doing work someone else was already doing