[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Review Request 114460: Remove even more redundant data from KItemListViewLayouter
From:       "Frank Reininghaus" <frank78ac () googlemail ! com>
Date:       2013-12-14 18:37:21
Message-ID: 20131214183721.17792.34736 () vidsolbach ! de
[Download RAW message or body]

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

Review request for Dolphin.


Repository: kde-baseapps


Description
-------

After https://git.reviewboard.kde.org/r/113487/, KItemListViewLayouter still stores \
quite a bit of redundant data.

For every item, we store the coordinates of its top-left corner in a QPointF 'pos' in \
the ItemInfo struct. This requires

2 * "number of items" doubles.

However, pos.x is the same for all items in one column, and pos.y is the same for all \
items in a row. Therefore, some memory can be saved by removing the 'pos' member, and \
adding two QVector<qreal>

m_rowOffsets and m_columnOffsets

instead. This reduces the memory requirement to

"number of rows + number of columns" doubles, which is at least 50% less.


Diffs
-----

  dolphin/src/kitemviews/private/kitemlistviewlayouter.h a3b0893 
  dolphin/src/kitemviews/private/kitemlistviewlayouter.cpp f5f63d5 

Diff: http://git.reviewboard.kde.org/r/114460/diff/


Testing
-------

Verfified with KSysGuard that the memory consumption is reduced as expected. View \
layout and scrolling still seem to work OK in all view modes and with grouping \
enabled or disabled.


Thanks,

Frank Reininghaus


[Attachment #3 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/114460/">http://git.reviewboard.kde.org/r/114460/</a>
  </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Dolphin.</div>
<div>By Frank Reininghaus.</div>










<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kde-baseapps
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">After https://git.reviewboard.kde.org/r/113487/, KItemListViewLayouter \
still stores quite a bit of redundant data.

For every item, we store the coordinates of its top-left corner in a QPointF \
&#39;pos&#39; in the ItemInfo struct. This requires

2 * &quot;number of items&quot; doubles.

However, pos.x is the same for all items in one column, and pos.y is the same for all \
items in a row. Therefore, some memory can be saved by removing the &#39;pos&#39; \
member, and adding two QVector&lt;qreal&gt;

m_rowOffsets and m_columnOffsets

instead. This reduces the memory requirement to

&quot;number of rows + number of columns&quot; doubles, which is at least 50% \
less.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Verfified with KSysGuard that the memory consumption is reduced as \
expected. View layout and scrolling still seem to work OK in all view modes and with \
grouping enabled or disabled.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>dolphin/src/kitemviews/private/kitemlistviewlayouter.h <span style="color: \
grey">(a3b0893)</span></li>

 <li>dolphin/src/kitemviews/private/kitemlistviewlayouter.cpp <span style="color: \
grey">(f5f63d5)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/114460/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>




  </div>
 </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic