EnderCore

EnderCore

87M Downloads

IProducer builds a new string each time the NonNull methods are called

mezz opened this issue ยท 0 comments

commented

I'm profiling the startup times and memory consumption of some big Minecraft packs, looking for things that are causing minor issues when pushed to the limits.
Every call to getItemNN() creates new strings. This seems to be called a lot during startup when setting up things for JEI. This accounted for around 300 MB of strings when I was profiling JEI during startup of ATM3.

return NullHelper.notnull(getItem(), "Item " + this + " is unexpectedly missing");

I think the usual way around this is to pass in a string with formatting args, use a lambda, or just inline the call so that a string is only created when there's an error.