GregTechCEu Modern

GregTechCEu Modern

6M Downloads

GregTech slows down `ItemTooltipEvent` massively

Technici4n opened this issue · 1 comments

commented

See AppliedEnergistics/Applied-Energistics-2#7698.

Zooming in on the profile:
image

The most likely culprit is

public static UnificationEntry getUnificationEntry(ItemLike itemLike) {
return ITEM_UNIFICATION_ENTRY_COLLECTED.computeIfAbsent(itemLike, item -> {
for (var entry : ITEM_UNIFICATION_ENTRY) {
if (entry.getKey().get().asItem() == itemLike.asItem()) {
return entry.getValue();
}
}
return null;
});
}
returning null from computeIfAbsent. To quote the documentation:

If the mapping function returns null, no mapping is recorded.

commented

Tested with the current Version: 1.1.3.b-build_516

Works now without a significant lagspike.
I've run a spark profiler and tried to reproduce the original Problem, theres still a small lag, but way less noticable then before.

https://spark.lucko.me/NnXiYS5kBh