[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: plugins,caches, startup time
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2016-09-30 14:23:52
Message-ID: CACcA1Rq90kRu5FCEW9tnRsjapo_c=TNepTbxsnXVA3cdw+UGhQ () mail ! gmail ! com
[Download RAW message or body]

On Fri, Sep 30, 2016 at 2:35 PM, Sebastian K=C3=BCgler <sebas@kde.org> wrot=
e:
> Hi,
>
> On Tuesday, September 27, 2016 4:52:22 PM UTC Marco Martin wrote:
>> as there is being some work in plugin caching right now, to see if /what=
 we
>> can save at startup time would be nice if different people on different
>> systems do some tests.
>> on his system, by indexing plugins Sebas saves about 2-300 milliseconds.=
 How
>> did you test that, so that we see wether we can reproduce it on differen=
t
>> systems, (may well be that on some kinds of hardware it's worth it, not =
on
>> some other)
>
> My measuring was done as follows:
> - I instrumented Plasma::PluginLoader and recorded all calls to
> KPluginLoader::findPackage(...)
> - I put these queries into an autotest, and instrumented that with timers=
 that
> measure the time spent in KPluginLoader::findPlugins(...), with and witho=
ut
> cache.
>
> So my tests are a little more synthetic. My code is in kcoreaddons[sebas/
> pluginindexer2], the index is generated with
>
> $ kpluginindexer -u
>
> Results on my fast system (core i7 + ssd) is that for Plasma startup, the
> indexed code runs about 200ms faster (out of a total ~700). That's not a =
lot
> of gain, IMO, and I'm unsure if it justifies the complexity added by
> maintaining an index.
>
> I haven't done any measurements on cold caches.
>
>> I did a similar test on kpackage plugin indexes, that's how all plasmoid=
s
>> get loaded, so it's quite a lot of them.
>
> Nice, I suppose KPackages are a little different to plugins, since there'=
s
> more overhead reading, the package metadata is stored as .desktop file, w=
hich
> means more conversion costs compared to the binary json that's in the plu=
gin
> binaries. Aleix has recently been looking into converting it to json, but=
 that
> would only save the .desktop to json part, binary json is still much quic=
ker
> to read (the format is pretty close to Qt's internal representation in me=
mory,
> deserialization is almost entirely I/O-bound.

It's not only about loading from json. Keep in mind that even adding a
cache we'll be loading each metadata.desktop a number of times either
way (both using KConfig parsing and KCoreAddons' DesktopFileParser).

My suggestion is to first get the type system right in
plasma-framework then we look into enforcing caches. I'm especially
afraid of this one as it will require quite a lot of work from the
packagers.
Furthermore, it would also be really interesting to look into reducing
plugin look-ups altogether, I'm almost sure that plugins are listed
several times on every boot.

Aleix
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic