I built a control that displays a bunch of containers that can be scrolled.
It has maybe 150 containers at a time.
The first time I load it, it’s very fast.
Every time I go to it again, it becomes notably slower. Consistently slower even with the same contents. After a few times it becomes pretty much unusable.
I profiled it, and it looks like it’s using next to no time at all.
I dropped some debugging output that shows the entire process rounds to 0 seconds. I figured it may just be browser update issue and am calling updateBrowser – no difference.
Hopefully someone will have a tip. I’m about to have to find another method to show the data, and this is my 3rd attempt to get something that would look ok and perform in a reasonably fast manner. .
May it’s better to insert all containers into another container and move only this one, if possible. I did this in a desktop project, worked OK so far on Windows. And very good on macOS.
The page that loads them, let’s call it PageEditor for example.
It has a single container control that is a subclassed control. Within it I manage all the positioning, scrolling, doing things like expanding some or hiding some, etc.
If I call New PageEditor( myData ) it becomes increasingly slower.
If I have PageEditor.setData myData, and from within that clear out all old controls, it’s reasonably quick.
So I do have a workaround, it just took me a long time to get to it. It also suggests something is going on like a memory leak - or something.
Make sure you’re not using Static on any of your pages or controls. It’s a good way to inadvertently share data among all instances (and across Sessions).