<table><tr><td style="">bruns updated this revision to Diff 78608.<br />bruns edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-rkr5ovld5zrp7td/">(Show Details)</a><br />bruns added reviewers: Baloo, ngraham.<br />bruns 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/D28328">View Revision</a></tr></table><br /><div><div><p>summary</p></div></div><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;"><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">The OptimizedByteArray may have been beneficial on 32bit archs, are less<br />
likely so on 64bit archs, and the possible gains are not worth the<br />
extra complexity.<br />
<br />
The OptimizedByteArray stores each path component as a separate<br />
QByteArray, shared over all directories. As each of these references<br />
amounts to a d-pointer, the minimal cost is 4/8 bytes (fully amortized),<br />
the maximum cost is 4/8 bytes + 16/24 bytes (QByteArray overhead) +<br />
strlen(component) + 1 + padding/alignment + libc alloc overhead (unique<br />
component name).<br />
<br />
I.e. for each watched directory where the average path component length<br />
it is a definite loss, for longer average length it depends on how often<br />
a long component is shared.<br />
<br />
As each component is permanently cached in a QSet this also leaks<br />
memory.</span></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R293 Baloo</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D28328?vs=78607&id=78608">https://phabricator.kde.org/D28328?vs=78607&id=78608</a></div></div><br /><div><strong>BRANCH</strong><div><div>submit</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D28328">https://phabricator.kde.org/D28328</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/file/kinotify.cpp<br />
src/file/optimizedbytearray.h</div></div></div><br /><div><strong>To: </strong>bruns, Baloo, ngraham<br /><strong>Cc: </strong>kde-frameworks-devel, Baloo, hurikhan77, lots0logs, LeGast00n, cblack, fbampaloukas, GB_2, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams<br /></div>