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





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On April 27th, 2016, 11:59 p.m. CEST, <b>David Edmundson</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="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;">I think you've spotted a problem, but this patch is treating the symptom not the cause.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">According to my logs, the constant loading of kdeglobals comes from:
  - 50x loading .protocol files (which shouldn't be including kdeglobals)
  - 10x loading .directory files (which shouldn't be including kdeglobals)
  - baloofilerc being loaded 8 times. (this is bug in baloo, it should probably include globals but only once)
  - frameworks integration explicitly loading kdeglobals. (this is a bug in frameworks integration)
  - knfsshare</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">With everything fixed that will be "only" loading it 3 times.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">That still means this will have some value, but a much smaller one.</p></pre>
 </blockquote>







</blockquote>

<pre style="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;">On the other hand it is a fact that every time you load KConfig, you'll have to go through the globals. This won't be a problem for dolphin (which was just an example) but will be for the rest. For example, most of KDevelop plugins will have a KConfig used. I understand that it makes sense to leverage such locality. Furthermore, caching doesn't only save us the reading and parsing, but also lets us save quite some QString instance (since if you parse twice, QString will allocate twice, whereas if you copy it will implicitly share).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">On the other hand, I completely agree that fixing those abuses is important and should be done.</p></pre>
<br />










<p>- Aleix</p>


<br />
<p>On April 27th, 2016, 6:14 p.m. CEST, Aleix Pol Gonzalez wrote:</p>








<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 KDE Frameworks and Matthew Dawson.</div>
<div>By Aleix Pol Gonzalez.</div>


<p style="color: grey;"><i>Updated April 27, 2016, 6:14 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kconfig
</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;">A next step for my little quest is improving KConfig impact upon start.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">In callgrind terms, 20% of dolphin's startup time is KConfig and 15% is parsing global files, which is essentially loading kdeglobals 70 times. This of course also means that kdeglobals is scattered 70 times in each application's memory space.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">To improve such situation, here's an attempt to cache these. I'm not an expert in KConfig, so feedback is really appreciated <a href="http://i1.kym-cdn.com/photos/images/facebook/000/234/765/b7e.jpg" style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">[1]</a></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;">Tests pass, KConfig becomes 6% of dolphin at load.</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>src/core/kconfig.cpp <span style="color: grey">(ad52da9)</span></li>

</ul>

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






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







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