From e3f7596a0ddc80834c93d6556467b20c26aab088 Mon Sep 17 00:00:00 2001 From: Jonathan Louie Date: Thu, 2 Nov 2023 11:37:27 -0700 Subject: [PATCH] Change number of threads in Benchmarking threadpool --- .../main/java/javababushka/benchmarks/utils/Benchmarking.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/utils/Benchmarking.java b/java/benchmarks/src/main/java/javababushka/benchmarks/utils/Benchmarking.java index 95d3a8ffac..8b4245ab62 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/utils/Benchmarking.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/utils/Benchmarking.java @@ -220,7 +220,7 @@ public static void testClientSetGet( concurrentNum, clientCount, tasks.size()); } long before = System.nanoTime(); - ExecutorService threadPool = Executors.newFixedThreadPool(concurrentNum); + ExecutorService threadPool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); // create threads and add them to the async pool. // This will start execution of all the concurrent tasks.