KFileItemModel::retrieveData() stores information about each item in a QHash<QByteArray, QVariant>. This is not necessary, however, if the information is equivalent to a default-constructed QVariant() (e.g., false for a bool or 0 for an int) because QHash::value() would return the very same value even if the information was not stored in the hash at all.
This not only wastes memory, but can, at least in large folders, cause an unnecessary delay when loading the folder because storing all this information in the hash requires time.
This problem is resolved by https://git.reviewboard.kde.org/r/111922/.
Git commit 938f773f1409ff037b718eadf427d7af25b915e0 by Frank Reininghaus.
Committed on 14/08/2013 at 21:57.
Pushed by freininghaus into branch 'KDE/4.11'.
Do not store default values in QHash<QByteArray, QVariant>
Storing values which are equivalent to default-constructed QVariants
does not make much sense because QHash::value returns the same value
even if the corresponding key is not found in the hash.
This commit reduces Dolphin's memory consumption in large folders by
up to 7.3% (tested a folder with 100,000 files in Details View) and
reduces the time required for loading a folder.
M +10 -17 dolphin/src/kitemviews/kfileitemmodel.cpp
M +0 -1 dolphin/src/kitemviews/kstandarditemlistwidget.cpp