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





<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KMymoney and Thomas Baumgart.</div>
<div>By Cristian OneČ›.</div>










<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
alkimia
</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Before this the biggest cost of using an AlkValue object, implicitly a KMyMoneyMoney object was assignment, construction and destruction.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">By using implicit sharing combined with a shared zero value, copying on assignment and construction can be greatly reduced.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Implicit sharing was easy to implement using QSharedDataPointer.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Bumped the library version because API changes were necessary. The mpq_class &valueRef() const method was bad beacause it was returning a non-const reference from a const function. Now There is a const version which will not detach the shared data while the non-const version will detach from the shared data.</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Succesfully ran KMyMoney and KMyMoney tests. See the attached screeshots for the callgrind data about AlkValue obtained while loading the same KMyMoney file without and with this change. Note that the second run also contains some MyMoneyMoney optimizations based on this feature (subject of a different review request).</p></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>libalkimia/CMakeLists.txt <span style="color: grey">(3dbe4db)</span></li>

 <li>libalkimia/alkvalue.h <span style="color: grey">(7c02403)</span></li>

 <li>libalkimia/alkvalue.cpp <span style="color: grey">(ae5d3a4)</span></li>

</ul>

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



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


 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/10/26/f79cfa4b-b01a-4d14-adbe-dc905ad1a4c9__alk-value.png">Callgrind data using AlkValue from alkimia 4.3.2</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/10/26/ceb1cb24-fe5e-414e-a0c1-09746bcb9bcc__alk-value-implicitly-shared.png">Callgrind data using AlkValue from alkimia 4.4.0 (with implicit sharing)</a></li>

</ul>




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




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