Replace QList by QVector in two places to reduce memory usage

Review Request #111304 - Created June 28, 2013 and submitted

Information
Frank Reininghaus
kde-baseapps
master
Reviewers
dolphin
Just the other day I noticed that we use QList in two places where the stored data type is larger than a pointer. In that case, QList stores not the items themselves in a contiguous memory block, but pointers to these items [1, 2]. This means that we have two unneeded pointers for every item, i.e., 16 bytes per item on a 64-bit system.

This can be changed in a rather straightforward way by replacing QList by QVector in these cases.

[1] http://marcmutz.wordpress.com/effective-qt/containers/
[2] http://doc.qt.digia.com/qq/qq19-containers.html
KSysguard confirms that we need a few megabytes less when loading folders with many items.
Emmanuel Pescosta
Commit Hook
Frank Reininghaus
Review request changed

Status: Closed (submitted)

Loading...