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!
Wish: abort option for Listview.Sort callback function
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Wish: abort option for Listview.Sort callback function
Not likely to be added because MUI doesn't support it...
Re: Wish: abort option for Listview.Sort callback function
Ok. No problem.airsoftsoftwair wrote: ↑Fri Sep 27, 2019 11:38 pm Not likely to be added because MUI doesn't support it...
![Smile :)](./images/smilies/icon_e_smile.gif)
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
![Smile :-)](./images/smilies/icon_e_smile.gif)
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.
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Wish: abort option for Listview.Sort callback function
Yes, it is just a single call so feel free to report this to http://muidev.de ...