<table><tr><td style="">broulik updated this revision to Diff 49537.<br />broulik retitled this revision from "Share Plasma::Theme instances between multiple Svg and ColorScope" to "Share Plasma::Theme instances between multiple ColorScope".<br />broulik edited the test plan for this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-jfowjrmywtq4uu2/">(Show Details)</a><br />broulik 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/D18149">View Revision</a></tr></table><br /><div><div><p>Focus on <tt style="background: #ebebeb; font-size: 13px;">ColorScope</tt> for now, <tt style="background: #ebebeb; font-size: 13px;">Svg</tt> is a tad more difficult.</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Use <tt style="background: #ebebeb; font-size: 13px;">QSharedPointer</tt></li>
</ul></div></div><br /><div><strong>CHANGES TO TEST PLAN</strong><div><div style="white-space: pre-wrap; color: #74777D;">Noticed in GammaRay there was a tonne of `Theme` objects.<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Just the usage in `Svg` alone accounted for 5ms startup time, and `ColorScope` is also widely used.<br />
After this patch there's merely 25 `Theme` objects being created.<br />
Wanted to use `QSharedPointer` for this but failed..<br />
Doesn't reduce refcount and cleanup when you assign a different theme using `Svg::setTheme` but this is hardly used anyway</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">Changing themes and changing color schemes still works</span>.<br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Changing t</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">Now get ~400 `T</span>heme<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">s and changing color schemes still works.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">` objects created rather than well over a thousand</span></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R242 Plasma Framework (Library)</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D18149?vs=49139&id=49537">https://phabricator.kde.org/D18149?vs=49139&id=49537</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D18149">https://phabricator.kde.org/D18149</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/declarativeimports/core/colorscope.cpp<br />
src/declarativeimports/core/colorscope.h</div></div></div><br /><div><strong>To: </strong>broulik, Plasma<br /><strong>Cc: </strong>apol, anthonyfieroni, kde-frameworks-devel, michaelh, ngraham, bruns<br /></div>