You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The usage of .getHoverName().getString() in the compare method of ComparatorAmount significantly degrades performance when the storage contains a large number of items. Since this method is called frequently during sorting, it introduces unnecessary overhead, especially when dealing with thousands of items.
Same thing goes for other comparators using getHoverName().getString()
Possibly can be replace with id or descriptionIds instead of getting & creating new String each time. I'm new into minecraft modding so I not sure if it possible to replace it with something else, if no them maybe cache them?
Minecraft 1.20.1
Forge 47.3.22
Mod version 1.7.0
I didn't test newer versions
The text was updated successfully, but these errors were encountered:
Performance Issue:
.getHoverName().getString()
Causes Significant Slowdown in Large StorageThe usage of
.getHoverName().getString()
in thecompare
method ofComparatorAmount
significantly degrades performance when the storage contains a large number of items. Since this method is called frequently during sorting, it introduces unnecessary overhead, especially when dealing with thousands of items.Same thing goes for other comparators using
getHoverName().getString()
Possibly can be replace with id or descriptionIds instead of getting & creating new String each time. I'm new into minecraft modding so I not sure if it possible to replace it with something else, if no them maybe cache them?
Minecraft 1.20.1
Forge 47.3.22
Mod version 1.7.0
I didn't test newer versions
The text was updated successfully, but these errors were encountered: