Plasma::Svg and performance
Aaron J. Seigo
aseigo at kde.org
Wed Oct 15 18:26:32 CEST 2008
On Wednesday 15 October 2008, Marco Martin wrote:
> ok, this patch is the idea, it seems to work, still has two problems dunno
> how relevant:
> -when checking for element existence it computes the rect, a bit of a
> waste, but this way don't have to keep two separate caches for rect and for
> existence
makes perfect sense; iirc finding the object and getting its rect are pretty
well equally expensive with QSvgRenderer, so it isn't a bad thing and will
keep memory usage down.
> -when checking for a non existent element it saves nothing
> because still invokes the renderer every time.. perhaps saving also a list
> of queried not existent elements?
would make sense, yes.
> (maybe imited to a fixed number of
> elements say 100 to not make it grow forever)
it will need to be a fixed size, yes, even without non-existent elements. 100
is probably too small though. this isn't a huge amount of data, really.
the actual problem with the patch is that it doesn't actually buy us anything:
once the renderer is created, we've lost. so it's the right start, just needs
the final bit to actually make your work here meaningful =)
the cache will need to be read from disk at startup and written to disk at
shutdown so that we can take advantage of previous look ups.
that way after the first run (or a new theme gets set) we can prevent creation
of QSvgRenderer objects (which easily lead to 1-2MB of allocation for parsing)
i'd suggest putting the cache in the Theme object, just as the pixmap cache
is.
--
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 Software
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20081015/8cf724b1/attachment.sig
More information about the Plasma-devel
mailing list