D18149: Share Plasma::Theme instances between multiple Svg and ColorScope

Kai Uwe Broulik noreply at phabricator.kde.org
Thu Jan 10 09:57:45 GMT 2019


broulik created this revision.
broulik added a reviewer: Plasma.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
broulik requested review of this revision.

REVISION SUMMARY
  Especially since the `Theme` isn't modified in any way but just used to read some data.
  While the `Private` part of `Theme` is already shared, creating a `Theme` instance still has some setup cost.

TEST PLAN
  Noticed in GammaRay there was a tonne of `Theme` objects.
  Just the usage in `Svg` alone accounted for 5ms startup time, and `ColorScope` is also widely used.
  After this patch there's merely 25 `Theme` objects being created.
  Wanted to use `QSharedPointer` for this but failed..
  Doesn't reduce refcount and cleanup when you assign a different theme using `Svg::setTheme` but this is hardly used anyway.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D18149

AFFECTED FILES
  src/declarativeimports/core/colorscope.cpp
  src/declarativeimports/core/colorscope.h
  src/plasma/private/svg_p.h
  src/plasma/svg.cpp

To: broulik, #plasma
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190110/d2bdbce8/attachment.html>


More information about the Kde-frameworks-devel mailing list