SuperMartijn642 / Tesseract

9 stars 9 forks source link

Causing long Tick times when multiple tesseracts are in unloaded chunks #50

Closed Petrify closed 1 year ago

Petrify commented 2 years ago

Issue:

Tesseracts were causing ticks to take long (2500+ ms) whenever an AE2 export bus tried to push items into the Tesseract. The Behavior can be replicated by using a hopper, so it's not AE2 specific. The Issue arose after building something that had 1 input tesseract and a total of 56 output tesseracts most of which were in different chunks from each other. In my case a distribution system for ammunition for turrets (See images below). I ran the Spark profiler on my server and traced it back to Tesseracts. You can view the Profiler's report here or alternatively upload the file contained in this archive to this website

From the Profiler's Stacktrace it seems that the call to com.supermartijn642.tesseract.manager.TesseractReference.isValid() loads the chunks of tesseracts that are unloaded, causing lots of chunks to be checked in a single tick. When the server restarts and forcefully unloads all these chunks, the tesseracts become unloaded and the issue begins.

Further notes:

Images:

2022-09-06_03 14 57 Sender Tesseract. Removing the Export Bus fixes the issue.

2022-09-06_03 31 56 Receiver Tesseracts. One beneath each turret

Hope this Report is thorough enough! If you require any more information shoot me a message

SuperMartijn642 commented 1 year ago

Thank you for reporting the issue!

I have made some significant performance improvements now in Tesseract version 1.0.30, so performance issues like this should now be fixed.