From 91e878ce39c9db112d658b3236f29a13e12724e6 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Tue, 7 Apr 2020 08:47:50 +0000 Subject: [PATCH] Revert "Prime SCL BindingRegistry to shave ~0.5s from startup" This reverts commit 8f99af83cee60676d80cf2334177ab94f82b7959. Reason for revert: Breaks selection view and other aspects about systems using Variables gitlab #491 Change-Id: I15003096cd13d738870278dd0c922bd9d0ed4ef5 --- .../scl/reflection/internal/Activator.java | 18 ------------------ .../internal/registry/BindingRegistry.java | 6 ------ .../internal/registry/Namespace.java | 2 +- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/Activator.java b/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/Activator.java index a14be4896..4e1d01816 100644 --- a/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/Activator.java +++ b/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/Activator.java @@ -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 diff --git a/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/registry/BindingRegistry.java b/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/registry/BindingRegistry.java index 648e314d9..f9bf3fadc 100644 --- a/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/registry/BindingRegistry.java +++ b/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/registry/BindingRegistry.java @@ -49,12 +49,6 @@ public class BindingRegistry { } } - public static void primeBindingRegistry() { - for (Namespace ns : namespaces.values()) { - ns.initializeValues(); - } - } - static { initialize(); if (DEBUG_INIT) { diff --git a/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/registry/Namespace.java b/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/registry/Namespace.java index 5234d3bfc..daaa204db 100644 --- a/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/registry/Namespace.java +++ b/bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/registry/Namespace.java @@ -275,7 +275,7 @@ public class Namespace { } } - synchronized void initializeValues() { + private synchronized void initializeValues() { if(values == null) { initializeTypes(); TypeBindingScheme scheme = MinimalTypeBindingScheme.INSTANCE; -- 2.47.1