Review Request 113487: Prevent storing some redundant data in KItemListViewLayouter
Commit Hook
null at kde.org
Wed Oct 30 16:43:11 GMT 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113487/#review42711
-----------------------------------------------------------
This review has been submitted with commit dcfed0028cedff63ed7545f2581ada69845c9bfd by Frank Reininghaus to branch master.
- Commit Hook
On Oct. 28, 2013, 6:53 p.m., Frank Reininghaus wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/113487/
> -----------------------------------------------------------
>
> (Updated Oct. 28, 2013, 6:53 p.m.)
>
>
> Review request for Dolphin.
>
>
> Repository: kde-baseapps
>
>
> Description
> -------
>
> In KItemListViewLayouter, we store a QRectF for each item, which is "the area that the item occupies". However, the size of the QRectF is already stored in the size hint resolver.
>
> Therefore, it is sufficient to store the position of the top left corner of the QRectF in a QPointF and construct the QRectF on demand. Even in the current version, the QRectF has to be moved by the current view offset anyway, but even if the patched version was slightly slower, it would not matter much because the QRectF is only constructed for the items which are shown on the screen (whose number may be much lower than the total number of items, for which we currently store all this redundant information).
>
> This patch reduces the memory usage by 16 bytes per item (a QRectF is 4 doubles -> 32 byes, a QPointF only 2 doubles -> 16 bytes).
>
>
> Diffs
> -----
>
> dolphin/src/kitemviews/private/kitemlistviewlayouter.h 306fcd3
> dolphin/src/kitemviews/private/kitemlistviewlayouter.cpp 1e97257
>
> Diff: http://git.reviewboard.kde.org/r/113487/diff/
>
>
> Testing
> -------
>
> I tested scrolling and rubber-band-selecting items in all view modes and could not find any regressions.
>
>
> Thanks,
>
> Frank Reininghaus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20131030/8746e3e4/attachment.htm>
More information about the kfm-devel
mailing list