From 23c5fce77fd9a4a9589a6ef6f98ec6375039d958 Mon Sep 17 00:00:00 2001 From: Jaime Torres Date: Sat, 14 Jul 2018 19:37:09 +0200 Subject: Speedup sort Summary: Uses a reference to the collator instead of copying and reinitializing it again and again. This is the reason for the speedup. Changing the implementation from a Functor class to a Lambda removes some boilerplate code, but is not relevant for performance. This requires a workaround for https://bugreports.qt.io/browse/QTBUG-69361 Just a single comparison to force the clean state of QCollator. Test Plan: Sorting in a directory with 82874 images: [TIME] Sorting: 19883 (before) [TIME] Sorting: 4198 (after) kfileitemmodelbenchmark before: .............. Passed 29.36 sec kfileitemmodelbenchmark after: .............. Passed 20.39 sec Reviewers: #dolphin, #frameworks, markg, elvisangelaccio, bruns Reviewed By: #dolphin, markg, elvisangelaccio Subscribers: elvisangelaccio, apol, bruns, markg, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D13814 --- src/kitemviews/kfileitemmodel.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/kitemviews/kfileitemmodel.h') diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index 134c50245..a931a28cc 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -499,7 +499,6 @@ private: // and done step after step in slotCompleted(). QSet m_urlsToExpand; - friend class KFileItemModelLessThan; // Accesses lessThan() method friend class KFileItemModelRolesUpdater; // Accesses emitSortProgress() method friend class KFileItemModelTest; // For unit testing friend class KFileItemModelBenchmark; // For unit testing -- cgit v1.3