From 902aca9c8e356f8298b0867f28043f63c141dfea Mon Sep 17 00:00:00 2001 From: Jonathan Lennox Date: Mon, 21 Oct 2024 17:04:50 -0400 Subject: [PATCH] Change default pool size. --- src/main/kotlin/org/ice4j/socket/SocketPool.kt | 2 +- src/test/kotlin/org/ice4j/socket/SocketPoolTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/ice4j/socket/SocketPool.kt b/src/main/kotlin/org/ice4j/socket/SocketPool.kt index 624e5b23..f47f56fd 100644 --- a/src/main/kotlin/org/ice4j/socket/SocketPool.kt +++ b/src/main/kotlin/org/ice4j/socket/SocketPool.kt @@ -57,7 +57,7 @@ class SocketPool( requestedNumSockets } else { // TODO: set this to 1 in situations where pools aren't needed? - Runtime.getRuntime().availableProcessors() + 2 * Runtime.getRuntime().availableProcessors() } private val sockets = buildList { diff --git a/src/test/kotlin/org/ice4j/socket/SocketPoolTest.kt b/src/test/kotlin/org/ice4j/socket/SocketPoolTest.kt index 0fe325ee..5914fcec 100644 --- a/src/test/kotlin/org/ice4j/socket/SocketPoolTest.kt +++ b/src/test/kotlin/org/ice4j/socket/SocketPoolTest.kt @@ -107,7 +107,7 @@ class SocketPoolTest : ShouldSpec() { val pool1 = SocketPool(loopbackAny, 1) val elapsed1 = sendTimeOnAllSockets(pool1) - // 0 means pick the default value, currently Runtime.getRuntime().availableProcessors(). + // 0 means pick the default value, currently 2 * Runtime.getRuntime().availableProcessors(). val poolN = SocketPool(loopbackAny, 0) val elapsedN = sendTimeOnAllSockets(poolN)