FrameSvg: sharing d->frames

Aaron J. Seigo aseigo at kde.org
Wed Sep 22 18:46:52 CEST 2010


hi all (but particularly Marco ;)

i was doing some digging into pixmap usage in plasma and found a few 
surprises. 

first, libplasma tends to use a _lot_ of FrameSvg object as if they were 
mostly free; they aren't. unlike Svg which is backed quite heavily by the 
cache in Theme, FrameSvg does a lot of local pixmap caching. we need to watch 
how freely we use that class. i manage to eliminate 1/2 the usage of them for 
widgets with focus indicators, so that's an improvement.

i also noticed that in many cases, FrameSvgs are creating and storing the same 
data. making the FrameData objects shared is another good way to save on 
pixmaps, and i have a nearly working patch based on a shared pool of reference 
counted objects. i'll post a review board patch for it when its ready, since 
it is a finicky patch (as any caching tends to be :)

finally, we have the PixmapTranstion animation. this thing is used all over in 
Plasma::Widgets, and has a particularly evil behaviour: even when it isn't 
transitioning between states it will generate at _least_ one new pixmap that 
is often simply a copy of the source and/or target pixmaps. this is primarly 
due to the centering algorithm, but also partly to the internal caching that 
is done in PixmapTransition. 

http://reviewboard.kde.org/r/5406/ address this part of the issue. this comes 
at a trade-off: whenever currentPixmap() is requested, it is regenerated 
unless the cache property of the animation is set to true.

the moral of the story is that there is a lot of headroom for improvement on 
pixmap usage in plasma, it seems, and as we do more and more fanciness, we 
should keep an eye on it.

kdumppixmap has been key to my work on this, so kudos to its author(s).

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100922/d76f2c69/attachment.sig 


More information about the Plasma-devel mailing list