Review Request 113487: Prevent storing some redundant data in KItemListViewLayouter

Frank Reininghaus frank78ac at googlemail.com
Wed Oct 30 16:43:16 GMT 2013


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

(Updated Oct. 30, 2013, 4:43 p.m.)


Status
------

This change has been marked as submitted.


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/949e1482/attachment.htm>


More information about the kfm-devel mailing list