Custom scrollbar implementation for ScrollingFrames causing high script activity spikes

Hi,

I designed a custom scrollbar module that serves the purpose of displaying and updating a custom backbar to replace the default slider that ScrollingFrames use. (the reason for this was ScrollingFrames’ sliders use offset for its sizing, which looks poor on lesser screen resolutions.)

In my project, I noticed when ever I would scroll in the scrolling frame, it would cause mass script activity spikes to occur. The amount it would spike is dependent on how many descendants are in the ScrollingFrame. This alone is weird, because my custom scrollbar module only handles updating the backbar/slider to be relative to the ScrollingFrame’s actual slider position and so forth. It does nothing in regards to the contents of the ScrollingFrame.

For additional reference/info, here’s the original thread I made: Optimization issues with custom scrollbar implementation - #2 by OhioTeacup

I decided to try a repro in a blank place. I took the entire UI and put it in there, and then I took the custom scrollbar module and placed a single script into the UI to initialize the custom scrollbar to begin updating.

To my surprise, the script activity spikes in the repro place were normal. It would go around ~1% or so on a 120 FPS update frequency. In my project place though, the script activity will spike increasingly higher as more descendants are added into the ScrollingFrame. It got nearly up to 20%! It’s so confusing though because my module does absolutely nothing to the ScrollingFrame’s contents.

Additionally, disabling my custom scrollbar functionality gets rid of the script activity spikes as I scroll in the ScrollingFrame.

Here’s a clip of me scrolling in the repro place

And then here’s another clip of the same module being used in the main game:

I’m stumped. I don’t know specifically if this is causing performance loss, although I have seen the ScrollingFrames struggle a bit with holding large numbers of items. I think in this test I had around 70.

Expected behavior

The code implementation for my custom scrollbar system should not yield activity spikes as high as what I’ve been seeing.

A private message is associated with this bug report

1 Like

This is just an acknowledgment announcement!

We’ve filed a ticket into our internal database for this issue, and we will update you when we have further information!

Thanks for the report!

1 Like