Review Request 121480: use QCollator instead of KStringHandler

Emmanuel Pescosta emmanuelpescosta099 at gmail.com
Sat Dec 13 22:16:27 GMT 2014



> On Dec. 13, 2014, 10:54 p.m., Mark Gaiser wrote:
> > Hi,
> > 
> > I invite you to read my blog post about exactly this subject [1]. The simple conclusion: QCollatorSortKey is faster in all cases even with bookkeeping.
> > 
> > As you probably know, a lot of effort has been spend by numerous people to make specifically the sorting operation faster. That didn't change KStringHandler because there was no successor for it at that time. The work for QCollator was known back then and it was remain to be seen if it would be a replacement for KStringHandler. Just using QCollator is the most horrible option when it comes to performace.
> > 
> > I would really recommend against moving to just QCollator. If you move to those classes, use QCollatorSortKey.
> > 
> > [1] http://kdeblog.mageprojects.com/2014/07/06/natural-string-sorting-an-in-depth-analysis/

Hi Mark, thanks for the info!

The aim of this patch is to move Dolphin a little bit more away from KDELibs4Support, so I decided to leave the QCollatorSortKey optimization away for now. (would blow up the number of changes immensely)

We can focus on optimizations (also includes QCollatorSortKey) after Dolphin is KDELibs4Support free and freed of porting bugs.

> Just using QCollator is the most horrible option when it comes to performace.

As far as I know the current KStringHandler natural compare also makes use of QCollator. (Wasn't there a RR some time ago?!)


- Emmanuel


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121480/#review71936
-----------------------------------------------------------


On Dec. 13, 2014, 9:13 p.m., Emmanuel Pescosta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121480/
> -----------------------------------------------------------
> 
> (Updated Dec. 13, 2014, 9:13 p.m.)
> 
> 
> Review request for Dolphin.
> 
> 
> Repository: kde-baseapps
> 
> 
> Description
> -------
> 
> Port away from KStringHandler naturalCompare to QCollator compare.
> 
> Make use of the QCollator instance (m_collator) in nameRoleGroups instead of using QString::localeAwareCompare (uses QCollator internally) to realise a locale aware less than.
> 
> We don't need the m_caseSensitivity anymore, because the QCollator instance also holds this information.
> 
> Removed the KFileItem::name to lower conversion because this makes the case sensitive fallback sorting in stringCompare useless.
> 
> (This patch doesn't make use of QCollatorSortKey)
> 
> 
> Diffs
> -----
> 
>   dolphin/src/kitemviews/kfileitemmodel.h d98d453 
>   dolphin/src/kitemviews/kfileitemmodel.cpp 711b079 
> 
> Diff: https://git.reviewboard.kde.org/r/121480/diff/
> 
> 
> Testing
> -------
> 
> Natural sorting works
> 
> 
> Thanks,
> 
> Emmanuel Pescosta
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20141213/c4ddacf9/attachment.htm>


More information about the kfm-devel mailing list