<table><tr><td style="">jtamate created this revision.<br />jtamate added reviewers: dfaure, Frameworks.<br />Restricted Application added a project: Frameworks.<br />jtamate requested review of this revision.
</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><strong>REVISION SUMMARY</strong><div><p>The two new UDS structures are similar to Frank's, but instead of using two vectors, use only one, with the index next to the data, and an overwritten == operator to test only the indexes (without it, the structures are slow).<br />
The first structure uses linear access and in the autotests is the fastest.<br />
The second structure uses binary access and scales better.</p>

<p>I've modified the last 3 test to measure insertion time and read time as used in KFileItemPrivate::cmp.</p>

<p>If you like one of the new structures, it can replace the one currently used in KIO::UDSEntryPrivate.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>run the test several times</p>

<p>The interesing results in my pc:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">INFO   : UdsEntryBenchmark::testTwoVectorsSlave() warmup stage result      : 56
INFO   : UdsEntryBenchmark::testTwoVectorsSlave() accumulation stage result: 55
PASS   : UdsEntryBenchmark::testTwoVectorsSlave()
RESULT : UdsEntryBenchmark::testTwoVectorsSlave():
     0.0016 msecs per iteration (total: 55, iterations: 32768)
INFO   : UdsEntryBenchmark::testTwoVectorsApp() warmup stage result      : 67
INFO   : UdsEntryBenchmark::testTwoVectorsApp() accumulation stage result: 68
PASS   : UdsEntryBenchmark::testTwoVectorsApp()
RESULT : UdsEntryBenchmark::testTwoVectorsApp():
     0.00051 msecs per iteration (total: 68, iterations: 131072)
INFO   : UdsEntryBenchmark::testTwoVectorsSlaveAnother() warmup stage result      : 89
INFO   : UdsEntryBenchmark::testTwoVectorsSlaveAnother() accumulation stage result: 91
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnother()
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnother():
     0.0013 msecs per iteration (total: 91, iterations: 65536)
INFO   : UdsEntryBenchmark::testTwoVectorsAppAnother() warmup stage result      : 64
INFO   : UdsEntryBenchmark::testTwoVectorsAppAnother() accumulation stage result: 64
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnother()
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnother():
     0.00048 msecs per iteration (total: 64, iterations: 131072)
INFO   : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2() warmup stage result      : 98
INFO   : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2() accumulation stage result: 101
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2()
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2():
     0.00154 msecs per iteration (total: 101, iterations: 65536)
INFO   : UdsEntryBenchmark::testTwoVectorsAppAnotherV2() warmup stage result      : 65
INFO   : UdsEntryBenchmark::testTwoVectorsAppAnotherV2() accumulation stage result: 68
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnotherV2()
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnotherV2():
     0.00051 msecs per iteration (total: 68, iterations: 131072)


PASS   : UdsEntryBenchmark::testTwoVectorsSlave()
RESULT : UdsEntryBenchmark::testTwoVectorsSlave():
     10,918 instruction reads per iteration (total: 10,918, iterations: 1)
PASS   : UdsEntryBenchmark::testTwoVectorsApp()
RESULT : UdsEntryBenchmark::testTwoVectorsApp():
     3,182 instruction reads per iteration (total: 3,182, iterations: 1)
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnother()
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnother():
     8,981 instruction reads per iteration (total: 8,981, iterations: 1)
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnother()
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnother():
     3,102 instruction reads per iteration (total: 3,102, iterations: 1)
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2()
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2():
     10,305 instruction reads per iteration (total: 10,305, iterations: 1)
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnotherV2()
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnotherV2():
     3,244 instruction reads per iteration (total: 3,244, iterations: 1)

PASS   : UdsEntryBenchmark::testTwoVectorsSlave()
RESULT : UdsEntryBenchmark::testTwoVectorsSlave():
     16,450 CPU ticks per iteration (total: 16,450, iterations: 1)
PASS   : UdsEntryBenchmark::testTwoVectorsApp()
RESULT : UdsEntryBenchmark::testTwoVectorsApp():
     4,736 CPU ticks per iteration (total: 4,736, iterations: 1)
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnother()
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnother():
     11,740 CPU ticks per iteration (total: 11,740, iterations: 1)
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnother()
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnother():
     4,297 CPU ticks per iteration (total: 4,297, iterations: 1)
PASS   : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2()
RESULT : UdsEntryBenchmark::testTwoVectorsSlaveAnotherV2():
     15,040 CPU ticks per iteration (total: 15,040, iterations: 1)
PASS   : UdsEntryBenchmark::testTwoVectorsAppAnotherV2()
RESULT : UdsEntryBenchmark::testTwoVectorsAppAnotherV2():
     5,136 CPU ticks per iteration (total: 5,136, iterations: 1)</pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></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>michaelh, bruns<br /></div>