<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/111643/">http://git.reviewboard.kde.org/r/111643/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#e0e0e0" width="100%" cellpadding="8" style="border: 1px gray solid;">
<tr>
<td>
<h1 style="margin-right: 0.2em; padding: 0; font-size: 10pt;">This change has been marked as submitted.</h1>
</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 KDevelop.</div>
<div>By Milian Wolff.</div>
<p style="color: grey;"><i>Updated July 25, 2013, 7:30 p.m.</i></p>
<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;">Use a QHash instead of a fixed-size QVector for the type system registry.
While this is of course slower, the impact is imo negleglible. The benchmark
shows that the TypeSystem becomes ~20% slower, but that is still nothing in
total compared to other parts of KDevelop which are actually much slower.
Thus, limiting the API in such a drastic way (only up to N types) is imo
not worth it. Instead we can take the small performance impact and improve
the performance elsewhere :)
Also note that to encounter a slowdown of ~1s one would need to call the TypeSystem
functions approx. 45 million times. Setting a counter breakpoint on TypeSystem::create
shows that it's being called less than one million times when loading my biggest KDevelop
session. So yeah, I think we can safely ignore this time impact and classify the existing
code as a premature optimization.
</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;">Before this patch:
PASS : TestDUChain::initTestCase()
RESULT : TestDUChain::benchTypeRegistry():"dataClassSize":
0.0000299 msecs per iteration (total: 299, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"dynamicSize":
0.0000438 msecs per iteration (total: 438, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"create":
0.0001276 msecs per iteration (total: 1,276, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"isFactoryLoaded":
0.0000271 msecs per iteration (total: 271, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"copy":
0.0001812 msecs per iteration (total: 1,812, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"copyNonDynamic":
0.0000409 msecs per iteration (total: 409, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"callDestructor":
0.0000306 msecs per iteration (total: 306, iterations: 10000000)
PASS : TestDUChain::benchTypeRegistry()
PASS : TestDUChain::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of TestDUChain *********
Performance counter stats for './duchaintest benchTypeRegistry -iterations 10000000':
10077.560833 task-clock # 0.995 CPUs utilized
214 context-switches # 0.021 K/sec
36 cpu-migrations # 0.004 K/sec
171,631 page-faults # 0.017 M/sec
11,717,686,879 cycles # 1.163 GHz [83.35%]
3,725,598,695 stalled-cycles-frontend # 31.79% frontend cycles idle [83.32%]
1,212,888,069 stalled-cycles-backend # 10.35% backend cycles idle [66.74%]
19,470,323,749 instructions # 1.66 insns per cycle
# 0.19 stalled cycles per insn [83.36%]
5,693,920,745 branches # 565.010 M/sec [83.33%]
1,995,259 branch-misses # 0.04% of all branches [83.27%]
10.124920649 seconds time elapsed
After this patch:
PASS : TestDUChain::initTestCase()
RESULT : TestDUChain::benchTypeRegistry():"dataClassSize":
0.0000310 msecs per iteration (total: 310, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"dynamicSize":
0.0000574 msecs per iteration (total: 574, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"create":
0.0001497 msecs per iteration (total: 1,497, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"isFactoryLoaded":
0.0000349 msecs per iteration (total: 349, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"copy":
0.0001863 msecs per iteration (total: 1,863, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"copyNonDynamic":
0.0000522 msecs per iteration (total: 522, iterations: 10000000)
RESULT : TestDUChain::benchTypeRegistry():"callDestructor":
0.0000480 msecs per iteration (total: 480, iterations: 10000000)
PASS : TestDUChain::benchTypeRegistry()
PASS : TestDUChain::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of TestDUChain *********
Performance counter stats for './duchaintest benchTypeRegistry -iterations 10000000':
11514.425401 task-clock # 0.992 CPUs utilized
463 context-switches # 0.040 K/sec
65 cpu-migrations # 0.006 K/sec
171,639 page-faults # 0.015 M/sec
14,606,973,287 cycles # 1.269 GHz [83.36%]
5,286,680,376 stalled-cycles-frontend # 36.19% frontend cycles idle [83.24%]
2,277,868,635 stalled-cycles-backend # 15.59% backend cycles idle [66.67%]
21,485,714,055 instructions # 1.47 insns per cycle
# 0.25 stalled cycles per insn [83.29%]
6,111,305,415 branches # 530.752 M/sec [83.38%]
2,157,996 branch-misses # 0.04% of all branches [83.35%]
11.609370777 seconds time elapsed
</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>language/duchain/types/typeregister.h <span style="color: grey">(4843eec)</span></li>
<li>language/duchain/types/typeregister.cpp <span style="color: grey">(90ed05f)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/111643/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>