Wish: abort option for Listview.Sort callback function

Discuss GUI programming with the MUI Royale plugin here
Post Reply
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Wish: abort option for Listview.Sort callback function

Post by lazi »

Dear Andreas!

What do you say for my wish for an ability to somehow abort the Listview.Sort function?
A sort operation can be very lengthy especially if Listview.SortFunc is used.
The CopyFile callback function can effectively abort the operation and something similar would be nice for the sorting function.

Thanks for your consideration!
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Wish: abort option for Listview.Sort callback function

Post by airsoftsoftwair »

Not likely to be added because MUI doesn't support it...
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Re: Wish: abort option for Listview.Sort callback function

Post by lazi »

airsoftsoftwair wrote: Fri Sep 27, 2019 11:38 pm Not likely to be added because MUI doesn't support it...
Ok. No problem. :)

Investigated the the case a bit more and interesting experiences I had.

MUI Sort method is really a slow one. Even if you clear the listview and insert all items again with "Sorted" position is faster by approx 10%. MorphOS MUI sorts two times faster than OS4 MUI on the same machine, but even that is seems to be slow.

Andreas, is this Sort method call a one call to the MUI class or need iteration? If it is just one call then I will ask some revisit from the OS4 MUI team because the differencies between the two OSs is very large.

Tried some other ways of making the list sorted and the fastest was really surprised me.

To save the list to a textfile, sort it by the system's sort command and read it back to the list is 20 times faster (yes, I mean twenty) than the MUI Sort method call. Even 15 times faster this way than using the Hollywood Sort() function. By the way ofcourse that is not UTF8 aware :-)

With huge lists (in my test case it had ~25000 items) I advise to use the system sort command for a sorted listview. With the mentioned item count it made the job 4.6 seconds instead of 119 seconds on OS4 and 2.7 seconds instead of 50 secs on MOS.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Wish: abort option for Listview.Sort callback function

Post by airsoftsoftwair »

lazi wrote: Sun Sep 29, 2019 1:16 pm Andreas, is this Sort method call a one call to the MUI class or need iteration? If it is just one call then I will ask some revisit from the OS4 MUI team because the differencies between the two OSs is very large.
Yes, it is just a single call so feel free to report this to http://muidev.de ...
Post Reply