Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Tree grid sorting performance Collapse All
Subject Author Date
Rado Manzela Sep 2, 2011 - 7:20 AM

I was asking about this long time ago and it is still problem for me. It seems recursive sorting of tree grid is very inefficient. In my case it seems to be about 5 times slower than populating the tree from scratch. It ruins my application performance.
Unfortunately it seems to be lot of work to recreate tree each time for me, because I’m selecting some columns from database, other are calculated and of course I would need to remember selected/focused/expanded/hidden cells, scroll positions plus it would change HTREEITEM handles.
Can you check the tree sorting please? There must be way to optimize it significantly. Maybe recreate tree internally with using existing cells and HTREEITEMs? Thank you.

Rado Manzela Sep 14, 2011 - 8:21 AM

So I had to study this by myself and got sorting of my tree from almost 2 minutes to 4 seconds. In prof-uis implementation there are too many calculations from HTREEITEM to row index and reverse (it is expensive operation BTW), maybe too many comparing and unnecessary moving of nodes, overall algorithm seems to be too complicated and unreadable for me which is bad sign :). If anybody is interested, to sort children of some node it is much faster to create list of HTREEITEMs for example into vector (I’m caching also caching row indexes), then use standard std:sort using custom function comparing rows, then use resulting vector to move nodes by HTREEITEMs to their position.