From 35da66fdceaf75e91f76417491a37854f020d433 Mon Sep 17 00:00:00 2001 From: Taejeong Lee Date: Thu, 23 May 2013 16:17:00 +0900 Subject: [PATCH] Improve performance in getting root plugins list. * note: this commit needs a new api from wrt-commons. - getRootPluginHandleList() [Issue#] N/A [Problem] Performance. [Cause] Too many access to db. [Solution] Changed to use new "getRootPluginHandleList()" Change-Id: Ie4c2191c1882c1ebd4afd9830f0c9f72612e764b --- src/plugin-loading/plugin_container_support.cpp | 16 ++-------------- src/plugin-loading/plugin_logic.cpp | 12 +++--------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/plugin-loading/plugin_container_support.cpp b/src/plugin-loading/plugin_container_support.cpp index 7eabd46..13dadd0 100644 --- a/src/plugin-loading/plugin_container_support.cpp +++ b/src/plugin-loading/plugin_container_support.cpp @@ -167,23 +167,11 @@ void PluginContainerSupport::registerPluginModel(DbPluginHandle handle) m_pluginModels.insert(model); } - void PluginContainerSupport::readRootPluginsList() +void PluginContainerSupport::readRootPluginsList() { LogDebug("Reading root plugins list from so files..."); - PluginHandleList pluginHandleList = - PluginDAOReadOnly::getPluginHandleList(); - - FOREACH(it_pluginHandle, pluginHandleList) - { - PluginDAOReadOnly pluginDao(*it_pluginHandle); - PluginHandleSetPtr retDependencies; - retDependencies = pluginDao.getLibraryDependencies(); - if (retDependencies->empty()) { - LogDebug("Root plugin Handle: " << *it_pluginHandle); - m_rootPluginsList.push_back(*it_pluginHandle); - } - } + m_rootPluginsList = PluginDAOReadOnly::getRootPluginHandleList(); } FeatureModelPtr diff --git a/src/plugin-loading/plugin_logic.cpp b/src/plugin-loading/plugin_logic.cpp index aef6950..1d96e96 100644 --- a/src/plugin-loading/plugin_logic.cpp +++ b/src/plugin-loading/plugin_logic.cpp @@ -255,18 +255,12 @@ void PluginLogic::Impl::initSession(int widgetHandle) //add standard objects LogDebug("Preload plugins so file"); - PluginContainerSupport::PluginsList pluginList = - m_pluginsSupport->getPluginsList(); + PluginContainerSupport::PluginsList rootPluginList = + m_pluginsSupport->getRootPlugins(); - FOREACH(it, pluginList) + FOREACH(it, rootPluginList) { PluginModelPtr& pluginModel = *it; - - if (!pluginModel->LibraryDependencies.Get()->empty()) { - // Only Root Object - continue; - } - PluginPtr pluginLib = pluginModel->LibraryInstance.Get(); if (!pluginLib) { -- 2.7.4