Review Request 113487: Prevent storing some redundant data in KItemListViewLayouter

Emmanuel Pescosta emmanuelpescosta099 at gmail.com
Tue Oct 29 14:06:28 GMT 2013


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

Ship it!


I have tested your patch and it works great!

No regression found so far.

- Emmanuel Pescosta


On Oct. 28, 2013, 7: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, 7: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/20131029/2ccf9ff3/attachment.htm>


More information about the kfm-devel mailing list