Netherite Crafter Causing Crazy Lag
cdelog opened this issue ยท 5 comments
Huge RS fanboy here who thinks ExtraStorage is the best thing since sliced bread. I've noticed that as you fill the Netherite Crafter up with patterns it starts to lag each time you add a new pattern. To the point that, by the time you add that last pattern, the screen freezes for a full second. I'm not 100% sure if it's server-side or client-side, but it almost feels like each time a pattern is inserted it does a validation thing on all the patterns and as more are inserted it takes longer each time to add one. Any ideas?
I'm playing on Enigmatica 6 0.4.2 on 1.16.4 which is using ExtraStorage-1.3.1, refinedstorage-1.9.12, with refinedstorageaddons-0.7.2.
I don't know if it is the same cause, but this is still a problem, and is bad enough to completely freeze the game.
I noticed that this doesn't happen when I just opened the world, the issue only occurs after a few minutes of playing
(i am playing in atm6)
From a quick look-see, it seems that the Invalidate method:
https://github.com/Edivad99/ExtraStorage/blob/3989cf824d440c1049624d247937876b1436c54f/src/main/java/edivad/extrastorage/nodes/AdvancedCrafterNetworkNode.java
validates all patterns in the crafter. If I'm reading this right, the crafter patternInventory:
https://github.com/Edivad99/ExtraStorage/blob/3989cf824d440c1049624d247937876b1436c54f/src/main/java/edivad/extrastorage/nodes/AdvancedCrafterNetworkNode.java
has a listener that upon receiving a new pattern runs the invalidate method, validating all crafts. So when I have a mostly full crafter and shift-swipe to add 10 patterns to it, it's trying to validate the entire crafter pattern inventory 10 times in a tick, causing the game to have a momentary stroke.
You're the expert here, but I wonder if performing validation on GUI close is an option rather than on patternInventory change, or would that mess up the scheme? I don't quite understand what happens if a recipe is invalid. If it actually stops you from inserting invalid recipes, I wonder if it could just drop invalid patterns on gui close? Just a thought. You're awesome!
I am also experiencing this lag. Based on a profile it looks like server side lag. Here is a spark profile showing the lag: https://spark.lucko.me/zBzn5ImaJU
All I did here was pull an inventory worth of patterns out of the crafter and put them back in during the profile.
Thanks for all the feedback, I am currently very busy with studies and projects. As soon as I have a free moment, I start investigating. Any suggestions are welcome