Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mezz opened this issue Aug 14, 2018 · 0 comments
Open

Comments

@mezz
Copy link

mezz commented Aug 14, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants