TWebPageControl Performance?

I use TWebPageControls all over the place and they work really, realy well. Super-useful in so many ways, I couldn't imagine working without them. However, I've recently run into an issue of performance when switching pages.

I have a TWebPageControl that has some TWebTabSheets that are filled with dozens of components and some that have litterally none (pages still in development). Switching between them is taking a long time, even swtiching between one blank page and another takes on the order of 2-3 seconds. On TWebPageControls that have fewer (total) components, switching time is barely noticeable. Note that I have TWebPageControls that themselves also have TWebPageControls in them.

When looking in the Google Chrome Performance tab, it seems all the time is spent within the rtl.module.rtl.createClass.DoUpdateResize call, which comes right after rtl.module.rtl.createClass.SetTabIndex and rtl.module.rtl.createClass.DoUpdateList.

This is starting to get beyond my level of understanding, but I'm guessing the DoUpdateResize call is not particularly picky about iterating through everything in TWebPageControl, whether it is visible or not or whether the page is visible or not? Seems if a page is not visible, it and its contents should be ignored entirely until it is? Not sure how I can bring about that kind of behaviour with the creative application of any enable/disable or beginupdate/endupdate calls anywhere? Certainly swtiching from one blank page to another should be instant, no?

The form that contains this particular TWebPageControl was also taking several seconds to load (dynamically) intitially, but marking it as Visible=False/Enabled=False in the IDE and then switching it on after the form loads considerably reduced the time taken to load the form. Likely the same issue.

Here's a (somewhat contrived, admittedly) sample project. The top TWebPageControl works fine of course because it is only very lightly popoulated. The bottom TWebPageControl is slow even on the blank pages, but especially on the first page, which also contains its own copy of a TWebPageControl. It is also setup with a TWebScrollBox which probably makes a contribution all its own to the performance, but the embedded page control isn't quite as snappy either.

TWebPageControlTest.zip (1.7 MB)

We applied an improvement for this. (impact is +/- 3x speed improvement).
Next update will have this improvement. Even with this improvement it is not like instant, because after all, there are a significant amount of controls all with their alignment involved here that needs to be recalculated when the tab switches.

Sounds fantastic, I can hardly wait !!

My hope is that it is only taking time when it is doing useful work, like when drawing elements that were previously hidden. So switching from a heavy page to a sparse page or swtiching between sparse pages should be pretty quick, but switching to a heavy page will incur a penalty. In the current version a similar penalty seems to be incurred that is related to all of the cotnents of all of the pages, no matter what pages are involved in the swtich. And presumably all the contents of a page can be hidden or shown "at once" in terms of the broswer updates, though this starts to stray into topics like virtual DOMs which may be beyond the reach of TWebPageControl?

I use these a lot, so any improvement is hugely appreciated, thanks!

With the improvement applied, switching to a light page is near instant now.

1 Like

This is so much faster in TMS WEB Core 1.9.8.2. Thanks very much!

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.