]> cloud.milkyroute.net Git - dolphin.git/commit
Save memory and time in KFileItemModel by lazy-loading the "ItemData"
authorFrank Reininghaus <frank78ac@googlemail.com>
Wed, 2 Oct 2013 17:08:39 +0000 (19:08 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Wed, 2 Oct 2013 17:08:39 +0000 (19:08 +0200)
commitae587d2682992644217c58968c6c771a1f2571f7
tree93bfd610a983db9a8bc32bf6e93e2c1dbe0534a8
parent926782d3be2502c6d3e87ef992aa371c081d72b4
Save memory and time in KFileItemModel by lazy-loading the "ItemData"

To reduce unnecessary memory comsumption and CPU usage, we only fill the
QHash<QByteArray, QVariant> if the methods data(int) or setData(int) are
called for the corresponding index, or the data is necessary for sorting
the model.

According to my tests, this patch reduces the memory usage when loading
a folder with 100,000 items by 17% in Icons View, and by 26% in Details
View.

REVIEW: 112725
src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kfileitemmodel.h