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:29 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111304/#review35303
-----------------------------------------------------------


This review has been submitted with commit 8aea59bb321987b781194d4e65786673f2b4ea27 by Frank Reininghaus to branch master.

- Commit Hook


On June 28, 2013, 8:05 p.m., Frank Reininghaus wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111304/
> -----------------------------------------------------------
> 
> (Updated June 28, 2013, 8:05 p.m.)
> 
> 
> 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/523dcfae/attachment.htm>


More information about the kfm-devel mailing list