You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/03/11 09:21:49 UTC

[GitHub] [skywalking] panniyuyu commented on a change in pull request #6537: Improve the performance of

panniyuyu commented on a change in pull request #6537:
URL: https://github.com/apache/skywalking/pull/6537#discussion_r592191897



##########
File path: oap-server/server-library/library-module/src/main/java/org/apache/skywalking/oap/server/library/module/ModuleManager.java
##########
@@ -40,21 +40,19 @@ public void init(
         ServiceLoader<ModuleDefine> moduleServiceLoader = ServiceLoader.load(ModuleDefine.class);
         ServiceLoader<ModuleProvider> moduleProviderLoader = ServiceLoader.load(ModuleProvider.class);
 
-        LinkedList<String> moduleList = new LinkedList<>(Arrays.asList(moduleNames));
+        HashSet<String> moduleSet = new HashSet<>(Arrays.asList(moduleNames));
         for (ModuleDefine module : moduleServiceLoader) {
-            for (String moduleName : moduleNames) {
-                if (moduleName.equals(module.name())) {
-                    module.prepare(this, applicationConfiguration.getModuleConfiguration(moduleName), moduleProviderLoader);
-                    loadedModules.put(moduleName, module);
-                    moduleList.remove(moduleName);
-                }
+            if (moduleSet.contains(module.name())) {
+                module.prepare(this, applicationConfiguration.getModuleConfiguration(module.name()), moduleProviderLoader);

Review comment:
       ignore




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org