On Tue Sep 3 10:44:08 2024 +0000, Zhiyi Zhang wrote:
Does this MR completely remove the slowdown for the application? If not, I suggest fixing this for listbox as well. Try to avoid redraws for listbox whenever it's possible.
Well, the slowdown is not completely absent even on Windows and it is not *completely* removed by this patch, although it reduces load time ~2.5 times and I believe this way the load time is tolerable (while still ~2-3 times longer than on Windows). FWIW this is technically a regression from introducing theming, with theming disabled the time roughly matches Windows (while of course it is not possible to display themed controls without introducing just any overhead).
The app is doing rather unoptimal thing, adds a huge amount of items to listbox without explicitly disabling redraws. My main motivation with this patch is to make some sensible and universally useful optimization without too much complication. There are normal cases when listbox has to be updated and the current update time being so big is the core problem.
Then maybe listbox has some room for optimization too but I suspect in this case the more likely outcome is not that the redraw can be avoided completely based on the listbox state (while I didn't exclude that possibility) but maybe it can determine that with given item count and scrollbar metrics the update will yield no changes.