Ideas for improving sorting. Goal: under 1 second for 200.000 files.

David Faure faure at kde.org
Sat Dec 8 09:05:00 GMT 2012


On Tuesday 23 October 2012 14:38:43 Mark wrote:
> 2.3 Pass around QChar* and get rid of QString
> -------------------
> Right now naturalCompare takes two QString arguments while it
> internally grabs a QChar* from the string. I'm not sure here, but i
> think you save some time if you prevent QString passing around and
> simply pass around QChar* then i imagine that you have a lot less
> unicode since the string arrays are already in unicode. That might be
> another (small?) speed improvement i guess.

This makes no sense, given that QString is really just a wrapper around
QChar* to add API on top.
"You have a lot less unicode" makes no sense, both QString and QChar* are 
unicode data.

There is no speed improvement to be gained by not calling this method:
inline const QChar *QString::unicode() const
{ return reinterpret_cast<const QChar*>(d->data); }
-> no work is done here.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5





More information about the kfm-devel mailing list