Author: ssmiweve
Date: 2009-09-29 22:16:20 +0200 (Tue, 29 Sep 2009)
New Revision: 7295

Modified:
   
branches/2.18/query-api/src/main/java/no/sesat/search/query/token/EvaluatorType.java
Log:
improve performance on EvaluatorType.getInstance()
 proved to be application bottleneck on a server with enough cpus.
 no API change.

Modified: 
branches/2.18/query-api/src/main/java/no/sesat/search/query/token/EvaluatorType.java
===================================================================
--- 
branches/2.18/query-api/src/main/java/no/sesat/search/query/token/EvaluatorType.java
        2009-09-28 18:45:06 UTC (rev 7294)
+++ 
branches/2.18/query-api/src/main/java/no/sesat/search/query/token/EvaluatorType.java
        2009-09-29 20:16:20 UTC (rev 7295)
@@ -1,4 +1,4 @@
-/* Copyright (2008) Schibsted ASA
+/* Copyright (2008-2009) Schibsted ASA
  * This file is part of SESAT.
  *
  *   SESAT is free software: you can redistribute it and/or modify
@@ -63,10 +63,11 @@
         return clsName;
     }
 
+    private static final Set<EvaluatorType> INSTANCES_SET
+            = Collections.unmodifiableSet(new 
HashSet<EvaluatorType>(INSTANCES.values()));
+
     public static Set<EvaluatorType> getInstances() {
-        synchronized (INSTANCES) {
-            return Collections.unmodifiableSet(new 
HashSet<EvaluatorType>(INSTANCES.values()));
-        }
+        return INSTANCES_SET;
     }
 
     public static EvaluatorType instanceOf(final String name){

_______________________________________________
Kernel-commits mailing list
Kernel-commits@sesat.no
http://sesat.no/mailman/listinfo/kernel-commits

Reply via email to