Primal Magick

Primal Magick

459k Downloads

Brief lag spikes upon opening arcane workbench gui

Gronglegrowth opened this issue ยท 2 comments

commented

When other mods which add their own recipe types are present, seems like the arcane workbench's recipe book tries to parse them and fails (may be wrong here), leading to some lag spike whenever the arcane workbench's gui is opened regardless of whether the recipe book is also open or not. One such error, with a woodcutting recipe from Hexerei:
[Render thread/WARN] [co.ve.pr.cl.re.ClientArcaneRecipeBook/]: Unknown recipe category: null/hexerei:woodcutting/mahogany/mahogany_connected_from_polished_mahogany_pillar_woodcutting

Mod version is 3.2.1

commented

Taking a very preliminary look around, I think you're on the right track.

https://github.com/daedalus4096/PrimalMagick/blob/master/src/main/java/com/verdantartifice/primalmagick/client/gui/recipe_book/ArcaneRecipeBookComponent.java#L99 is invoked every time the GUI's opened, causing it to completely refresh the recipe list each time.

Cheap in single-mod, but crunchy in multimod and yep, happens whether or not the component's visible.

ResearchManager#progressResearch calls out to add the recipes to the player's book, and SyncProgressPacket (if it's invoked) pushes the update to the player; this should be able to handle updating for new research. Clearly this is here because there's a gap.

A deeper dive'll be needed, probably starting with yanking that sync and seeing what happens. Then probably looking into threading eventing such that when research is updated, the arcane book gets an update.

Also squelching that unknown recipe log line since a few hundred of those every time we open the recipe book isn't going to be great anyway.

commented

This should be fixed in the next release, currently planned at v4.0.4. Thanks for the report!