]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Revert "Prime SCL BindingRegistry to shave ~0.5s from startup" 14/4114/2
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 7 Apr 2020 08:47:50 +0000 (08:47 +0000)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 7 Apr 2020 08:49:13 +0000 (08:49 +0000)
This reverts commit 8f99af83cee60676d80cf2334177ab94f82b7959.

Reason for revert: Breaks selection view and other aspects about systems using Variables

gitlab #491

Change-Id: I15003096cd13d738870278dd0c922bd9d0ed4ef5

bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/Activator.java
bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/registry/BindingRegistry.java
bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/registry/Namespace.java

index a14be489618d659c6bf394405bce1e2d8868ac04..4e1d01816381d3ca486bae5b558f07f9af5cb7b2 100644 (file)
@@ -1,14 +1,11 @@
 package org.simantics.scl.reflection.internal;
 
-import java.util.concurrent.ForkJoinPool;
-
 import org.eclipse.core.runtime.ILog;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
-import org.simantics.scl.reflection.internal.registry.BindingRegistry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -23,21 +20,6 @@ public class Activator implements BundleActivator {
     public void start(BundleContext context) throws Exception {
         this.context = context;
         instance = this;
-        
-        primeBindingRegistry();
-    }
-
-    private static void primeBindingRegistry() {
-        LOGGER.info("Priming BindingRegistry");
-        ForkJoinPool.commonPool().submit(() -> {
-            try {
-                // this forces static initialzation of the registry in advance
-                BindingRegistry.primeBindingRegistry();
-            } catch (Exception e) {
-                LOGGER.error("Could not prime binding registry", e);
-            }
-            LOGGER.info("Priming done");
-        });
     }
 
     @Override
index 648e314d9a2f95c9dc659615514f0133c1efbf64..f9bf3fadcc9aa3bfa47155909949d136dfe3796a 100644 (file)
@@ -49,12 +49,6 @@ public class BindingRegistry {
         }
     }
     
-    public static void primeBindingRegistry() {
-        for (Namespace ns : namespaces.values()) {
-            ns.initializeValues();
-        }
-    }
-    
     static {
         initialize();
         if (DEBUG_INIT) {
index 5234d3bfc95ab456f61ceff4c5e06e134ddeaab7..daaa204dbe708c971969ba65a3ef68bb73390651 100644 (file)
@@ -275,7 +275,7 @@ public class Namespace {
         }
     }        
         
-    synchronized void initializeValues() {
+    private synchronized void initializeValues() {
         if(values == null) {
             initializeTypes();
             TypeBindingScheme scheme = MinimalTypeBindingScheme.INSTANCE;