<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="https://git.reviewboard.kde.org/r/115680/">https://git.reviewboard.kde.org/r/115680/</a>
     </td>
    </tr>
   </table>
   <br />











<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/115680/diff/1/?file=243397#file243397line71" style="color: black; font-weight: bold; text-decoration: underline;">kmymoney/mymoney/mymoneyobjectcontainer.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">71</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">for</span> <span class="p">(</span><span class="k">typename</span> <span class="n">CacheType</span><span class="o">::</span><span class="n">iterator</span> <span class="n">it</span> <span class="o">=</span> <span class="n">map</span><span class="p">.</span><span class="n">begin</span><span class="p">();</span> <span class="n">it</span> <span class="o">!=</span> <span class="n">map</span><span class="p">.</span><span class="n">end</span><span class="p">();</span> <span class="o">++</span><span class="n">it</span><span class="p">)</span> <span class="p">{</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Only style: you can use qDeleteAll() for this ( http://qt-project.org/doc/qt-4.8/qtalgorithms.html#qDeleteAll-2 , map.clear() is still needed then)</pre>
</div>
<br />



<p>- Christian David</p>


<br />
<p>On February 11th, 2014, 8:55 p.m. CET, Cristian OneČ› wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://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 KMymoney and Thomas Baumgart.</div>
<div>By Cristian OneČ›.</div>


<p style="color: grey;"><i>Updated Feb. 11, 2014, 8:55 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kmymoney
</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;">Performance optimization of the mymoney object container.

The MyMoneyObjectContainer::account(QString) was the most costly
method of this class. Mainly due to the calls to dynamic_cast
needed to obtain the cached MyMoneyObject with it's proper type.

Improved this by:
1. implementing a per object type cache.
2. using QHash instead of QMap which provides faster lookups
3. replace macro method implementation with template methods

Thomas again I need your blessing for this :). I removed all method implementations by macros even though I have to admit that the file would be shorter using macros.</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;">Ran unit test. Profiled application and observed a performance improvement.</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>kmymoney/mymoney/mymoneyobjectcontainer.h <span style="color: grey">(2abc0f06632b4c29f6443ab3ad66cccf6a4ce1d9)</span></li>

 <li>kmymoney/mymoney/mymoneyobjectcontainer.cpp <span style="color: grey">(796d9aa8cb44de5a449bb54f1a46e313ff65cf0d)</span></li>

</ul>

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



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments </h1>

<ul>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/02/11/5a184cd9-42d1-4bbf-9fc2-0709b0987d14__file-load-before.png">File load before optimization</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/02/11/4b430712-a66e-410c-9a1a-15f990370043__file-load-after.png">File load after optimization</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/02/11/eaa62d0b-1035-481e-a947-fac60fd6f388__register-load-before.png">Register load before optimization</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/02/11/55f57547-1b6b-436e-bd23-89c43da23be8__register-load-after.png">Register load after optimization</a></li>

</ul>





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








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