Open Zyro1331 opened 1 month ago
Hmm... this is a bit odd, because it should already be doing that - when it's off, it should just stop updating.
How exactly are you detecting that it's the cause of the lag spikes? It could be something else potentially or the mechanism is broken.
Hmm... this is a bit odd, because it should already be doing that - when it's off, it should just stop updating.
How exactly are you detecting that it's the cause of the lag spikes? It could be something else potentially or the mechanism is broken.
Under the additional context section, I link to a comment I made on issue #2895 where I completely take out all the facets on the Worlds screen, showing that the lag spikes correlate to the behaviour of it refreshing. With my own experiments, I've used a Userspace inspector to set the IdleSortDelay to a value of 120 and now I only see the lag spike every two minutes.
With additional some small testing with a standalone WorldListFacetPreset, I also determined that new worlds and sessions continue to populate even while the whole slot hierarchy is disabled or even while the component is disabled. It's only upon disabling the slot that the WorldListFacet component is attached is when it stops updating the world list.
Ah I see! Thanks for the info. I'll poke around this when I can.
Unless somebody else wants to steal this: @BlueCyro @RyuviTheViali
I'll put this on my docket
Is your feature request related to a problem? Please describe.
Currently, most users on mid-range computers experience a moderate lag spike every ~5 seconds due to the WorldListFacet refreshing itself. This lag spike will continue to repeatedly occur even while the Worlds tab is closed or while the whole Dashboard is closed.
Upon switching tabs in the Dashboard or closing it, the Dash disables various slot hierarchies to save a bit of performance. The WorldListFacet doesn't exactly obey having its component or it's parent slots disabled, as it will continue to refresh according to the IdleSortDelay parameter. Only upon disabling the slot that the WorldListFacet is attached to will disable the constant refreshing of Worlds. (You can see evidence of this happening by monitoring the components "IsSearching" value, and then playing with the active state of the slot hierarchy until it stops repeatedly changing.)
Describe the solution you'd like
The WorldListFacet component should temporarily disable Refreshing / Sorting when the slot hierarchy above or component itself is disabled. This will alleviate the repetitive ~5 second lag spikes and make things feel a little bit smoother for average users.
Describe alternatives you've considered
A small potential problem with the solution above is upon users interacting with the Worlds tab after having it closed for a while is going to see largely out-of-date world data for a few seconds before the World List gets to refresh itself. Instead of completely disabling the WorldListFacet's refreshing behaviour while inactive, it could just have its IdleSortDelay be increased to something like 60 - 120 seconds, that way it feels less obtrusive when getting fresh World list data in the background.
Additional Context
You can see an example of this issue being first observed here: https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2895#issuecomment-2334864111 Just a few comments down from the previous, you can see me finding the cause and even proving that it's related to the Worlds tab refreshing itself: https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2895#issuecomment-2342959006
Requesters
@zyro1331