D14009: [Plasma PluginLoader] Cache plugins during startup
This revision was automatically updated to reflect the committed changes. Closed by commit R242:af01c2e95370: [Plasma PluginLoader] Cache plugins during startup (authored by broulik). REPOSITORY R242 Plasma Framework (Library) CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D14009?vs=37473=38259 REVISION DETAIL https://phabricator.kde.org/D14009 AFFECTED FILES src/plasma/pluginloader.cpp To: broulik, #plasma, davidedmundson, mart Cc: ngraham, zzag, kde-frameworks-devel, michaelh, bruns
D14009: [Plasma PluginLoader] Cache plugins during startup
broulik added inline comments. INLINE COMMENTS > davidedmundson wrote in pluginloader.cpp:195 > Seems the wrong approach we know the ID, there's no point iterating in the > first place. > > https://api.kde.org/frameworks/kcoreaddons/html/classKPluginLoader.html#a3a69c4f1826926a2145f14770b8b5010 We know the ID but not the file name of the library, so `findPlugin` won't work. REPOSITORY R242 Plasma Framework (Library) REVISION DETAIL https://phabricator.kde.org/D14009 To: broulik, #plasma, davidedmundson, mart Cc: ngraham, zzag, kde-frameworks-devel, michaelh, bruns
D14009: [Plasma PluginLoader] Cache plugins during startup
davidedmundson added inline comments. INLINE COMMENTS > pluginloader.cpp:195 > // COMPAT CODE for applets installed into the toplevel plugins dir > by mistake. > -plugins = KPluginLoader::findPlugins(QString(), filter); > } Seems the wrong approach we know the ID, there's no point iterating in the first place. https://api.kde.org/frameworks/kcoreaddons/html/classKPluginLoader.html#a3a69c4f1826926a2145f14770b8b5010 REPOSITORY R242 Plasma Framework (Library) REVISION DETAIL https://phabricator.kde.org/D14009 To: broulik, #plasma, davidedmundson, mart Cc: ngraham, zzag, kde-frameworks-devel, michaelh, bruns
D14009: [Plasma PluginLoader] Cache plugins during startup
mart accepted this revision. This revision is now accepted and ready to land. REPOSITORY R242 Plasma Framework (Library) REVISION DETAIL https://phabricator.kde.org/D14009 To: broulik, #plasma, davidedmundson, mart Cc: ngraham, zzag, kde-frameworks-devel, michaelh, bruns
D14009: [Plasma PluginLoader] Cache plugins during startup
broulik updated this revision to Diff 37473. broulik added a comment. - Move code REPOSITORY R242 Plasma Framework (Library) CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D14009?vs=37470=37473 REVISION DETAIL https://phabricator.kde.org/D14009 AFFECTED FILES src/plasma/pluginloader.cpp To: broulik, #plasma, davidedmundson, mart Cc: zzag, kde-frameworks-devel, michaelh, ngraham, bruns
D14009: [Plasma PluginLoader] Cache plugins during startup
zzag added inline comments. INLINE COMMENTS > pluginloader.cpp:194-196 > +const QString pluginName = name.section(QLatin1Char('/'), -1); > > +QVector plugins; Nitpick: IMHO, it would be better to move these two down (right before `if (useRuntimeCache) {`). So, cache invalidation and cache population stuff goes first, then querying stuff. REPOSITORY R242 Plasma Framework (Library) REVISION DETAIL https://phabricator.kde.org/D14009 To: broulik, #plasma, davidedmundson, mart Cc: zzag, kde-frameworks-devel, michaelh, ngraham, bruns
D14009: [Plasma PluginLoader] Cache plugins during startup
broulik created this revision. broulik added reviewers: Plasma, davidedmundson, mart. Restricted Application added a project: Frameworks. Restricted Application added a subscriber: kde-frameworks-devel. broulik requested review of this revision. REVISION SUMMARY Similar to KPackage's cache this speeds up startup where plugins are repeatedly looked up. Especially the fallback path of looking in the plugin root directly causes quite some slowdown. TEST PLAN Speeds up plasmashell startup by ~175ms both with and without dropped caches on my laptop Verified that all applets load fine and that adding applets (both QML-only and C++ applets) after the startup period works fine REPOSITORY R242 Plasma Framework (Library) REVISION DETAIL https://phabricator.kde.org/D14009 AFFECTED FILES src/plasma/pluginloader.cpp To: broulik, #plasma, davidedmundson, mart Cc: kde-frameworks-devel, michaelh, ngraham, bruns