<table><tr><td style="">mwolff created this revision.<br />mwolff added a reviewer: dfaure.<br />Restricted Application added a project: Frameworks.<br />Restricted Application added a subscriber: Frameworks.<br />mwolff 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/D9822" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>All benchmarks create a relatively large directory tree and then<br />
watch that recursively. On my system, the timings are:</p>

<p>RESULT : KDirWatch_UnitTest::benchCreateTree():</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);">34.2 msecs per iteration (total: 342, iterations: 10)</pre></div>

<p>PASS   : KDirWatch_UnitTest::benchCreateWatcher()<br />
RESULT : KDirWatch_UnitTest::benchCreateWatcher():</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);">13.6 msecs per iteration (total: 137, iterations: 10)</pre></div>

<p>PASS   : KDirWatch_UnitTest::benchNotifyWatcher()<br />
RESULT : KDirWatch_UnitTest::benchNotifyWatcher():</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);">113.7 msecs per iteration (total: 1,138, iterations: 10)</pre></div>

<p>Note that this time includes wait/sleep time and the latency<br />
induced by the kernel for the inotify events to arrive. Measuring<br />
on-CPU time can be done by passing <tt style="background: #ebebeb; font-size: 13px;">-perf</tt> to the benchmarks:</p>

<p>PASS   : KDirWatch_UnitTest::benchCreateTree():<br />
RESULT : KDirWatch_UnitTest::benchCreateTree():</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);">165,910,830.4 CPU cycles per iteration (total: 1,659,108,304, iterations: 10)</pre></div>

<p>PASS   : KDirWatch_UnitTest::benchCreateWatcher()<br />
RESULT : KDirWatch_UnitTest::benchCreateWatcher():</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);">64,014,469.8 CPU cycles per iteration (total: 640,144,699, iterations: 10)</pre></div>

<p>PASS   : KDirWatch_UnitTest::benchNotifyWatcher()<br />
RESULT : KDirWatch_UnitTest::benchNotifyWatcher():</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);">316,077,005.5 CPU cycles per iteration (total: 3,160,770,055, iterations: 10)</pre></div>

<p>The first benchmark measures the time it takes to create the large<br />
directory. See below for why this is useful information.</p>

<p>The second measures how long it takes to add the root dir<br />
and its contents recursively.</p>

<p>The third one touches all files in the tree and measure how long it<br />
takes until all dirty signals arrive. If you subtract that measurement<br />
from the third benchmark, you arrive at the overhead imposed by<br />
KDirWatch. At this point, it's quite high!</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R244 KCoreAddons</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D9822" rel="noreferrer">https://phabricator.kde.org/D9822</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/kdirwatch_unittest.cpp</div></div></div><br /><div><strong>To: </strong>mwolff, dfaure<br /><strong>Cc: </strong>Frameworks<br /></div>