[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 307585] Sorting is too cpu intensive for big folders
From:       Frank Reininghaus <frank78ac () googlemail ! com>
Date:       2012-10-06 12:35:49
Message-ID: bug-307585-17878-k4gE5hVJ6X () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=307585

--- Comment #26 from Frank Reininghaus <frank78ac@googlemail.com> ---
I don't know how "ls" does it, but the only obvious way to speed up the
comparison that I can see at the moment would be to cache some intermediate
results which KStringHandler::naturalCompare() needs. All these isDigit() calls
are needed to split the string into a sequence of number and non-number chunks.
One could do this splitting just once and use this to do a faster comparison.
The slow part would then only be done N times, and the O(N*log(N)) comparisions
would be fast.

I want to make clear though that I do not believe that this approach should be
implemented. I don't think that the time saving for this corner case would be
worth the greatly increased code complexity and maintenance effort. As soon as
we implement this, someone will probably try to open a folder with a million
files, and the next bottleneck will show up.

-- 
You are receiving this mail because:
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic