Review Request 111304: Replace QList by QVector in two places to reduce memory usage
Commit Hook
null at kde.org
Sun Jun 30 13:28:33 BST 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111304/
-----------------------------------------------------------
(Updated June 30, 2013, 12:28 p.m.)
Status
------
This change has been marked as submitted.
Review request for Dolphin.
Description
-------
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
Diffs
-----
dolphin/src/kitemviews/private/kitemlistsizehintresolver.h 1345e03
dolphin/src/kitemviews/private/kitemlistsizehintresolver.cpp c76ff0f
dolphin/src/kitemviews/private/kitemlistviewlayouter.h 5ca73e1
Diff: http://git.reviewboard.kde.org/r/111304/diff/
Testing
-------
KSysguard confirms that we need a few megabytes less when loading folders with many items.
Thanks,
Frank Reininghaus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20130630/5afa2a37/attachment.htm>
More information about the kfm-devel
mailing list