Refactor KCoreDirLister(Cache) to use KFileItemListV2 where possible.
AbandonedPublic

Authored by markg on Feb 8 2018, 12:22 AM.

Details

Reviewers
dfaure
Summary

This refactors KFileItemList uses to KFileItemListV2 where possible.
In terms of performance there isn't any change really. I did meassure it with callgrind but it seems roughtly the same when running Dolphin with it. If anything it's marginally faster, but that could just be the specific case.
Another folder might be the same.

Test Plan

Test Dolphin, run the tests. The relevant ones (kdirmodeltest and kfileitemtest) seem to pass just fine.

Diff Detail

Repository
R241 KIO
Branch
refactor_dirlistercache
Lint
No Linters Available
Unit
No Unit Test Coverage
markg created this revision.Feb 8 2018, 12:22 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 8 2018, 12:22 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
markg requested review of this revision.Feb 8 2018, 12:22 AM
markg updated this revision to Diff 26739.Feb 8 2018, 12:27 AM

Get rid of the temp file.

dfaure requested changes to this revision.Feb 8 2018, 7:02 AM

See, I almost asked in the previous commit "are you sure that this is going to be faster?", and this patch answers it. It's not.
Which is logical, since you are not able to benefit from move semantics anywhere in this patch (so it's just appending to a QList vs appending to a vector -- same performance), while OTOH you have to introduce slow conversion functions from vector to list.

-2, this isn't going to help.
At most, make that a KF6 TODO that KFileItemList should inherit std::vector (ideally with an #if version check for the kio version, not just a comment, so that we don't forget).

src/core/kcoredirlister.cpp
1934

The actual performance fix would be to add deletedItems.reserve(itemsToDelete.size()) here...

2576

right, so this patch in fact makes things slower.

2594

slower

This revision now requires changes to proceed.Feb 8 2018, 7:02 AM
markg abandoned this revision.Feb 13 2018, 12:53 PM

As this is a no-go, rightfully so! Abandoning it.