-
Notifications
You must be signed in to change notification settings - Fork 792
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
[1.20.1] Having a lot of mods causes TC JEI loading to slow down to a crawl (~45 seconds to load) #5290
Comments
Can you start a Spark profile running on the client with |
Here's the spark profile: |
What happens if you change the client config to show everything? Basically, JEI in 1.20 no longer supports me not adding something to JEI that's in creative. My only choice that doesn't break my own creative tabs is to remove the content from JEI after the fact. I'm assuming the issue is not generating the list of its, but rather the remove at runtime in JEI being unoptimized |
Hm, I had low memory search enabled because the modpack is kind of hardware taxing and I don't want it to be more taxing than it needs. |
Well, there shouldn't be 8000 items being removed at runtime. I'll see if there is a way I can detect from the creative tab builder that we are in JEI which would make this notably faster |
I believe JEI implements ingredient removal by searching for each one and then removing it if found. If low memory search is used, each search takes time proportional to the total number of ingredients, which means removals will become much slower than with regular search. |
Took a quick look at this profile, seems that equal to the time we spend removing ingredients is the time Create spends adding spout recipes. Which is likely due to their look over every single item in JEI and loading its capabilities (capabilities are slow in Forge). Did the issue entirely go away when you changed that config option? I suppose that may be causing latency during a different point in your world startup.
Low memory search probably means they throw away any search related data structures after searching instead of saving them for the next search. Saves you RAM at the cost of every search operation taking more time. |
I've looked into this issue further and just don't see an alternative to my current approach of removing ingredients at runtime. I believe I'll need a new JEI hook if I wanted to do anything; some sort of "should I add ingredient from your creative tab" hook. Alternatively, if JEI just passed in something I can recognize as part of the creative tab builder parameters I could condition off that; e.g. a particular fake feature flag I can look for. Such a hook would probably also help Create's plugin go faster as there are not a ton of fluid items added to the item list now (though I'd still advise against resolving capabilities on every single stack...) Can you crosspost this issue to JEI's issue tracker? |
When I disabled Low Memory Search, the time has changed to about ~425ms for Tinkers' Construct but Create still takes that ridiculous amount of time. The only way I fixed the Create problem is by simply using "return" in the spout recipe function and commenting all the code, causing the recipes to not register at all, which does not bother me per se, but it's a bandaid fix for a problem of a larger scope. EDIT: But indeed you're correct about the capabilities, because the snippet of code I commented calls Forge Capabilities about two times for each liquid, iirc. Not fluent in Java though so, don't expect any knowledge from me :-D |
To add to this, I would be interested in how Immersive Engineering handles those recipes, because they've got recipes for filling all the liquids to a bucket in the game but it doesn't take nearly as much as Create does. |
Most people.just iterate the item registry, not the JEI ingredient registry. |
Minecraft Version
1.20.1
Modloader
Forge
Modloader Version
47.3.0
Mantle Version
1.11.28
Tinkers' Construct Version
3.9.0.6
Describe your issue
From what I understand, TC tries to automatically generate copper cans for each liquid in the game, crafting stations from some blocks in the game, and lanterns with liquids too. This is good, but, in large modpacks (in my case, about 200 mods add actual content but about 20 are responsible for most of the liquids), is quite the taxing endeavour;
[01Jan2025 10:54:49.206] [Render thread/INFO] [mezz.jei.library.ingredients.IngredientManager/]: Ingredients are being removed at runtime: 9807 net.minecraft.world.item.ItemStack
Note that this does not entirely comprise from Copper Can recipes being removed, Copper Cans represent only about 1116 of those items, rest of which are generated scorched/seared lanterns, fuel tanks and fuel gauges.
In terms of Crafting Stations, there's about 800 of them, same seems to be with Part Builders. It seems they try to load Chipped blocks though, which is kind of brutal.
Time aftermath: [01Jan2025 10:55:34.326] [Render thread/INFO] [mezz.jei.library.load.PluginCallerTimerRunnable/]: Sending Runtime: tconstruct:jei_plugin took 45.12 seconds
Provided the entire log in the crash report.
Interestingly enough, despite spamming the log so much, there are no copper cans in JEI anyway, so what's this all about?
Crash Report
https://gist.github.com/carbonatek/f01663a28515fdb67b97363ddebb94a2
Other mods
I have not tried it with less mods, because obviously, it would load faster.
Major liquid providers (as in, they provide a lot of liquids, sorted by amount) in the modpack:
Tried reproducing with just Tinkers?
No
Performance Enchancers
Rubidium/Embeddium
Searched for known issues?
Searched open issues
The text was updated successfully, but these errors were encountered: