GregTechCEu / GregTech-Modern

GregTech CE Unofficial for modern versions
GNU Lesser General Public License v3.0
263 stars 152 forks source link

GregTech slows down `ItemTooltipEvent` massively #964

Closed Technici4n closed 6 months ago

Technici4n commented 6 months ago

See https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/7698.

Zooming in on the profile: image

The most likely culprit is https://github.com/GregTechCEu/GregTech-Modern/blob/7554d1d69d173bf361cdcefc7d2428324a7c0a2e/src/main/java/com/gregtechceu/gtceu/api/data/chemical/ChemicalHelper.java#L225-L234 returning null from computeIfAbsent. To quote the documentation:

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

MKr4zy commented 6 months ago

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