<table><tr><td style="">dkurz updated this revision to Diff 17705.<br />dkurz retitled this revision from "Reduce heap allocs by using QVector instead of QList" to "Avoid mem allocs by using stack allocated initializer lists".<br />dkurz edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-4ueobsbrzl6e53j/" rel="noreferrer">(Show Details)</a>
</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/D7110" rel="noreferrer">View Revision</a></tr></table><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(251, 175, 175, .7);">We only create the containers replaced by this patch<br />
to iterate over it, and we know its size a priori. QVector<br />
with its initializer list ctor should be used in such cases<br />
due to less heap allocations, memory consumption,</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">The old code has one allocation in QList::operator<< per action.</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">cache misses</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">The new code avoids heap allocs completely</span>.</div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R206 KMail</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D7110?vs=17652&id=17705" rel="noreferrer">https://phabricator.kde.org/D7110?vs=17652&id=17705</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D7110" rel="noreferrer">https://phabricator.kde.org/D7110</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/kmmainwidget.cpp</div></div></div><br /><div><strong>To: </strong>dkurz, KDE PIM: KMail<br /><strong>Cc: </strong>dvratil, mlaurent, KDE PIM, dvasin, winterz, vkrause, knauss<br /></div>