felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1629086 - /felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.benchmark/src/org/apache/felix/dm/benchmark/scenario/Helper.java
Date Thu, 02 Oct 2014 22:17:37 GMT
Author: pderop
Date: Thu Oct  2 22:17:36 2014
New Revision: 1629086

URL: http://svn.apache.org/r1629086
Log:
Use ForkJoinPool instead of java.util.ThreadPoolExecutor (FJP is faster, especially when there
are many available processors).
(tested with 128 processors).

Modified:
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.benchmark/src/org/apache/felix/dm/benchmark/scenario/Helper.java

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.benchmark/src/org/apache/felix/dm/benchmark/scenario/Helper.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.benchmark/src/org/apache/felix/dm/benchmark/scenario/Helper.java?rev=1629086&r1=1629085&r2=1629086&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.benchmark/src/org/apache/felix/dm/benchmark/scenario/Helper.java
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.benchmark/src/org/apache/felix/dm/benchmark/scenario/Helper.java
Thu Oct  2 22:17:36 2014
@@ -1,6 +1,7 @@
 package org.apache.felix.dm.benchmark.scenario;
 
 import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ForkJoinPool;
 import java.util.concurrent.LinkedTransferQueue;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
@@ -25,7 +26,7 @@ public class Helper {
      * Threadpool which can be optionally used by parallel scenarios.
      */
     private final static int CORES = Runtime.getRuntime().availableProcessors();
-    private final static ExecutorService TPOOL = new ThreadPoolExecutor(CORES, CORES, 0L,
TimeUnit.MILLISECONDS, new LinkedTransferQueue<Runnable>());
+    private final static ExecutorService TPOOL = new ForkJoinPool(CORES);
     
     /**
      * Get the threadpool, possibly needed by some scenario supporting parallel mode



Mime
View raw message