Diffusion KIO 20b89972b643

get rid of the raw KFileItem pointers in KCoreDirListerCache

Authored by jtamate on Oct 9 2018, 4:45 PM.

Description

get rid of the raw KFileItem pointers in KCoreDirListerCache

Summary:
Do a TODO introduced in 4b498196899223692e8a7d334618b2874bb6c77e in 2014.
Don't depend on the internal memory layout of the containers, and get rid of NonMovableFileItem.
Use the new 2 operands < of KFileItem to sort by url.

Sorting lstItems and the use of binary search in findByUrl gets the following results:
adding items to lstItems is almost as fast as before, only 3 msecs slower on average.
findByName is as slow as before.
findByUrl is on average >200x faster.

Test Plan:
Pass kio unittests (behind a proxy, therefore ktcpsockettest fails at 261 sec).

Before:
Total Test time (real) = 706.64 sec
After:
Total Test time (real) = 352.63 sec

Using dolphin, in a folder with 15000 files, select them all and rename them to a# (second time to b#), and as soon as it start renaming, go up two directories to not interfere with the refreshes.
Before: 4m 30s to finish
After: 1m 12s to finish

Reviewers: Frameworks, dfaure

Reviewed By: dfaure

Subscribers: bruns, kde-frameworks-devel, mwolff, markg

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D10742