Thanks for the info about print causing this, it was really helpful when looking into this.
So it turns out this isn’t actually caused by the SettingsHub at all, it’s caused by the Developer Console module which is required by the SettingsHub script. The main problem is that the developer console re-draws the output log when not on screen, a secondary problem is that this seems overly slow (it causes noticeable lag when outputting 10 messages in one frame).
I know that there is a developer console re-write coming up soon so I made the minimally invasive fix of just not re-drawing the output log when the developer console isn’t visible.
Here is the pull request, hopefully @spotco or @24RightAngles could look into merging this or committing a similar change internally.
The same just happened for me. I launched my game from the website and ran around for a bit. I’m not sure what triggered it, but a few minutes in I suddenly started getting lag spikes. I haven’t been able to reproduce.
I found the cause of this I believe a while ago and I thought I posted it here but I guess not. The issue happens once you’ve reached a certain amount of prints to the server and as such only causes lag on the developers client. The longer the game is open, the worse the issue will become
Once I realized this was my issue I just went and cleaned up my prints to output and it went away
My best guess is that at a certain number of prints the developer console will just shift up the text to the next line instead of shifting the guis themselves.
This appears to be very bad for performance because setting the Text and other gui properties of hundreds of guis is not a fast operation – and it’s happening every time a print is made. This can happen not just with server output but with client output too, as seen in the linked thread.