plugins,caches, startup time

Sebastian Kügler sebas at kde.org
Fri Sep 30 22:18:21 UTC 2016


On Friday, September 30, 2016 4:23:52 PM UTC Aleix Pol wrote:
> > Nice, I suppose KPackages are a little different to plugins, since there's
> > more overhead reading, the package metadata is stored as .desktop file,
> > which means more conversion costs compared to the binary json that's in
> > the plugin 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 quicker to read (the format is pretty close to Qt's
> > internal representation in memory, 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).

No we won't, the caching code stores/restores a binary json file, 
deserialization of that is really cheap, the KPluginMetaData is created from 
the json object, which is the cheapest constructor you could think of (it 
neither has to go through DesktopFileParser nor JSON deserialization, see 
kcoreaddons[sebas/kpluginindex2]/src/lib/plugin/kpluginloader.cpp:283

When *creating* the cache, yes, we have to go through DesktopFileParser or, 
once we've migrated everything to metadata.json, through Qt's JSON 
deserialization. The cache will be faster to read in both cases.

> 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.

I think so, too.

Also, I tend to agree to make our code better instead of adding caching. I'm 
rather unhappy with the impact on packagers, as you note.
-- 
sebas

Sebastian Kügler    •    http://vizZzion.orghttp://www.kde.org


More information about the Plasma-devel mailing list