<table><tr><td style="">jtamate updated this revision to Diff 34708.<br />jtamate edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-icr7jf3b5j4kyxe/">(Show Details)</a><br />jtamate edited the test plan for this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-4yryvkobccotb6i/">(Show Details)</a><br />jtamate added a comment.<br />Restricted Application added a subscriber: kde-frameworks-devel.
</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/D10742">View Revision</a></tr></table><br /><div><div><p>Based on the tests done in <a href="https://phabricator.kde.org/D12945" class="remarkup-link" target="_blank" rel="noreferrer">D12945</a> and <a href="https://phabricator.kde.org/D11282" class="remarkup-link" target="_blank" rel="noreferrer">D11282</a>, the best solution is to have the result of qHash(url) in KFileItem to compare items in the binary search.<br />
In two cases, the KFileItem in the list has to be moved to the right position, this is still faster than before.<br />
Introduce two methods to insert an item into the list and to move the item to the right position.</p>

<p>The crash in kdirmodeltest was due to getting twice the signal of a file changed into a directory.</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>Don't depend on the internal memory layout of the containers, and get rid of NonMovableFileItem.<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"><br />
KFileItem gets 3 new operands < and a new member m_hash with the qHash of the item url.</span><br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Any tiny performance regression is eclipsed by the change of lstItems to hashItems</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">Sorting lstItems and the use of binary search in findByUrl gets the following results:<br />
adding items to lstItems is as fast as before.<br />
findByName is as slow as before.<br />
findByUrl is >200x faster</span>.</div></div></div><br /><div><strong>CHANGES TO TEST PLAN</strong><div><div style="white-space: pre-wrap; color: #74777D;">Pass the unittests<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> (behind a proxy, therefore ktcpsockettest  fails at 261 sec)</span>.<br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">Before:<br />
Total Test time (real) = 706.64 sec<br />
After:<br />
Total Test time (real) = 404.91 sec<br />
</span></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/D10742?vs=29572&id=34708">https://phabricator.kde.org/D10742?vs=29572&id=34708</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D10742">https://phabricator.kde.org/D10742</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/core/kcoredirlister.cpp<br />
src/core/kcoredirlister_p.h<br />
src/core/kfileitem.cpp<br />
src/core/kfileitem.h<br />
src/widgets/kdirmodel.cpp</div></div></div><br /><div><strong>To: </strong>jtamate, Frameworks, dfaure<br /><strong>Cc: </strong>kde-frameworks-devel, mwolff, markg, michaelh, ngraham, bruns<br /></div>