<table><tr><td style="">jtamate updated this revision to Diff 33505.<br />jtamate marked 3 inline comments as done.<br />jtamate edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-belnzzfmx5r6cla/">(Show Details)</a><br />jtamate edited the test plan for this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-tpcudfq5qh6cegw/">(Show Details)</a><br />jtamate added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D12659">View Revision</a></tr></table><br /><div><div><p>Fixed the ordered insertion.<br />
Using std::vector and std::find_if.<br />
Initialize everything to try to detect a change of type in a "insert" over a different type.</p>

<p>Using templates to reduce somehow the code size.<br />
The last 3 structures are tested 3 times:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Fill the structure</li>
<li class="remarkup-list-item">Compare two structures</li>
<li class="remarkup-list-item">Read 3 values</li>
</ul>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>When you say "scales better", we're talking about the number of fields in the udsentry, not the number of items. But kioslaves don't fill in 1000 fields, so I have the feeling that scaling with the number of fields isn't a requirement.</p></blockquote>

<p>Yes, I was talking about the number of fields in the udsentry. I had to test it, just in case.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Are those benchmarks run in Release (or RelWithDebInfo) mode, rather than Debug (which is a big no no for benchmarks)? Qt should be compiled with optimizations enabled too.</p></blockquote>

<p>Yes, since the last comment of <a href="https://phabricator.kde.org/D11487" class="remarkup-link" target="_blank" rel="noreferrer">D11487</a> everything is compiled with -O2 -mtune=native<br />
Qt is the one provided by OpenSuse.</p></div></div><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;"><div style="padding: 8px 0;">...</div>The second structure uses binary access and scales better<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> in the number of fields</span>. <br />
<br />
I've <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">modified</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">added to</span> the last 3 test <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">to measure insertion time and</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">a new one to measure</span> read time as used in KFileItemPrivate::cmp.<div style="padding: 8px 0;">...</div></div></div></div><br /><div><strong>CHANGES TO TEST PLAN</strong><div><div style="white-space: pre-wrap; color: #74777D;">run the test several times<br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">The interesing results in my pc:<br />
<br />
<br />
```<br />
INFO   : UdsEntryBenchmark::testTwoVectorsSlave() warmup stage result      : 56<br />
INFO   : UdsEntryBenchmark::testTwoVectorsSlave() accumulation stage result: 55<br />
PASS   : UdsEntryBenchmark::testTwoVectorsSlave()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsSlave():<br />
     0.0016 msecs per iteration (total: 55, iterations: 32768)<br />
INFO   : UdsEntryBenchmark::testTwoVectorsApp() warmup stage result      : 67<br />
INFO   : UdsEntryBenchmark::testTwoVectorsApp() accumulation stage result: 68<br />
PASS   : UdsEntryBenchmark::testTwoVectorsApp()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsApp():<br />
     0.00051 msecs per iteration (total: 68, iterations: 131072)<br />
INFO   : UdsEntryBenchmark::testTwoVectorsSlaveAnother() warmup stage result      : 89<br />
INFO   : UdsEntryBenchmark::testTwoVectorsSlaveAnother() accumulation stage result: 91<br />
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnother()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnother():<br />
     0.0013 msecs per iteration (total: 91, iterations: 65536)<br />
INFO   : UdsEntryBenchmark::testTwoVectorsAppAnother() warmup stage result      : 64<br />
INFO   : UdsEntryBenchmark::testTwoVectorsAppAnother() accumulation stage result: 64<br />
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnother()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnother():<br />
     0.00048 msecs per iteration (total: 64, iterations: 131072)<br />
INFO   : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2() warmup stage result      : 98<br />
INFO   : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2() accumulation stage result: 101<br />
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2():<br />
     0.00154 msecs per iteration (total: 101, iterations: 65536)<br />
INFO   : UdsEntryBenchmark::testTwoVectorsAppAnotherV2() warmup stage result      : 65<br />
INFO   : UdsEntryBenchmark::testTwoVectorsAppAnotherV2() accumulation stage result: 68<br />
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnotherV2()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnotherV2():<br />
     0.00051 msecs per iteration (total: 68, iterations: 131072)<br />
<br />
<br />
PASS   : UdsEntryBenchmark::testTwoVectorsSlave()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsSlave():<br />
     10,918 instruction reads per iteration (total: 10,918, iterations: 1)<br />
PASS   : UdsEntryBenchmark::testTwoVectorsApp()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsApp():<br />
     3,182 instruction reads per iteration (total: 3,182, iterations: 1)<br />
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnother()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnother():<br />
     8,981 instruction reads per iteration (total: 8,981, iterations: 1)<br />
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnother()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnother():<br />
     3,102 instruction reads per iteration (total: 3,102, iterations: 1)<br />
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2():<br />
     10,305 instruction reads per iteration (total: 10,305, iterations: 1)<br />
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnotherV2()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnotherV2():<br />
     3,244 instruction reads per iteration (total: 3,244, iterations: 1)<br />
<br />
PASS   : UdsEntryBenchmark::testTwoVectorsSlave()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsSlave():<br />
     16,450 CPU ticks per iteration (total: 16,450, iterations: 1)<br />
PASS   : UdsEntryBenchmark::testTwoVectorsApp()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsApp():<br />
     4,736 CPU ticks per iteration (total: 4,736, iterations: 1)<br />
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnother()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnother():<br />
     11,740 CPU ticks per iteration (total: 11,740, iterations: 1)<br />
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnother()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnother():<br />
     4,297 CPU ticks per iteration (total: 4,297, iterations: 1)<br />
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2():<br />
     15,040 CPU ticks per iteration (total: 15,040, iterations: 1)<br />
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnotherV2()<br />
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnotherV2():<br />
     5,136 CPU ticks per iteration (total: 5,136, iterations: 1)<br />
</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">The interesing results in my pc: (using parameter -vb)<br />
<br />
<br />
```<br />
     0.00056 msecs per iteration (total: 74, iterations: 131072)<br />
     0.00032 msecs per iteration (total: 86, iterations: 262144)<br />
     0.00053 msecs per iteration (total: 70, iterations: 131072)<br />
<br />
     0.00037 msecs per iteration (total: 98, iterations: 262144)<br />
     0.00017 msecs per iteration (total: 93, iterations: 524288)<br />
     0.00048 msecs per iteration (total: 64, iterations: 131072)<br />
<br />
     0.00041 msecs per iteration (total: 54, iterations: 131072)<br />
     0.00021 msecs per iteration (total: 57, iterations: 262144)<br />
     0.00048 msecs per iteration (total: 64, iterations: 131072)</span><br />
<br />
```</div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D12659?vs=33480&id=33505">https://phabricator.kde.org/D12659?vs=33480&id=33505</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D12659">https://phabricator.kde.org/D12659</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/udsentry_benchmark.cpp</div></div></div><br /><div><strong>To: </strong>jtamate, dfaure, Frameworks<br /><strong>Cc: </strong>bruns, michaelh<br /></div>