From c5c72a3cdb244371783494a68aa2af8707680258 Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Thu, 16 Oct 2025 16:52:26 +0100 Subject: [PATCH 01/12] add benchmarks --- .../jmh/kotlin/benchmarks/ChannelBenchmark.kt | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt new file mode 100644 index 0000000000..a40e759f28 --- /dev/null +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -0,0 +1,104 @@ +package benchmarks + +import kotlinx.coroutines.* +import kotlinx.coroutines.channels.* +import org.openjdk.jmh.annotations.* +import java.util.concurrent.* + +@Warmup(iterations = 7, time = 1) +@Measurement(iterations = 10, time = 1) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@State(Scope.Benchmark) +@Fork(1) +open class ChannelBenchmark { + // max coroutines launched per benchmark + // to allow for true parallelism + val cores = 4 + + // 4 KB, 40 KB, 400 KB, 4 MB, 40 MB, 400 MB + @Param("1000", "10000", "100000", "1000000", "10000000", "100000000") + var count: Int = 0 + + // 1. Preallocate. + // 2. Different values to avoid helping the cache. + val list = ArrayList(100000000).apply { + repeat(100000000) { add(it) } + } + + @Benchmark + fun sendUnlimited() = runBlocking { + runSend(count, Channel.UNLIMITED) + } + + @Benchmark + fun sendConflated() = runBlocking { + runSend(count, Channel.CONFLATED) + } + + @Benchmark + fun sendReceiveUnlimited() = runBlocking(Dispatchers.Default) { + runSendReceive(count, Channel.UNLIMITED) + } + + @Benchmark + fun sendReceiveConflated() = runBlocking(Dispatchers.Default) { + runSendReceive(count, Channel.CONFLATED) + } + + @Benchmark + fun sendReceiveRendezvous() = runBlocking(Dispatchers.Default) { + // NB: Rendezvous is partly benchmarking the scheduler, not the channel alone. + // So don't trust the Rendezvous results too much. + runSendReceive(count, Channel.RENDEZVOUS) + } + + @Benchmark + fun oneSenderManyReceivers() = runBlocking { + runSendReceive(count, Channel.UNLIMITED, 1, cores) + } + + @Benchmark + fun manySendersOneReceiver() = runBlocking { + runSendReceive(count, Channel.UNLIMITED, cores, 1) + } + + @Benchmark + fun manySendersManyReceivers() = runBlocking { + runSendReceive(count, Channel.UNLIMITED, cores / 2, cores / 2) + } + + private suspend fun send(count: Int, channel: Channel) = coroutineScope { + list.take(count).forEach { channel.send(it) } + } + + private suspend fun runSend(count: Int, capacity: Int) { + Channel(capacity).also { + send(count, it) + } + } + + // NB: not all parameter combinations make sense in general. + // E.g., for the rendezvous channel, senders should be equal to receivers. + // If they are non-equal, it's a special case of performance under contention. + private suspend inline fun runSendReceive(count: Int, capacity: Int, senders: Int = 1, receivers: Int = 1) = + withContext(Dispatchers.Default) { + require(senders > 0 && receivers > 0) + + val channel = Channel(capacity) + repeat(receivers) { + launch { + channel.consumeEach { } + } + } + + coroutineScope { + repeat(senders) { + launch { + send(count / senders, channel) + } + } + } + channel.close() + } +} From 37be0330ef2ef38f166582e777bc89ef8096c709 Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Tue, 28 Oct 2025 17:53:36 +0000 Subject: [PATCH 02/12] avoid allocating (avoid list.take(count)) --- benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt index a40e759f28..41aade3831 100644 --- a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -69,7 +69,9 @@ open class ChannelBenchmark { } private suspend fun send(count: Int, channel: Channel) = coroutineScope { - list.take(count).forEach { channel.send(it) } + for (i in 1..count) { + channel.send(list[i]) + } } private suspend fun runSend(count: Int, capacity: Int) { From 038399294c7b7bb948bfe3d67cb5006b77d935e8 Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Tue, 28 Oct 2025 18:13:41 +0000 Subject: [PATCH 03/12] rename send to sendManyItems to avoid false hinting at Channel.send --- benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt index 41aade3831..52f6c78863 100644 --- a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -68,7 +68,7 @@ open class ChannelBenchmark { runSendReceive(count, Channel.UNLIMITED, cores / 2, cores / 2) } - private suspend fun send(count: Int, channel: Channel) = coroutineScope { + private suspend fun sendManyItems(count: Int, channel: Channel) = coroutineScope { for (i in 1..count) { channel.send(list[i]) } @@ -76,7 +76,7 @@ open class ChannelBenchmark { private suspend fun runSend(count: Int, capacity: Int) { Channel(capacity).also { - send(count, it) + sendManyItems(count, it) } } @@ -97,7 +97,7 @@ open class ChannelBenchmark { coroutineScope { repeat(senders) { launch { - send(count / senders, channel) + sendManyItems(count / senders, channel) } } } From 33f9e722c9d9b028cb90b7010c89f6dad118bfe0 Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Wed, 29 Oct 2025 10:15:40 +0000 Subject: [PATCH 04/12] make senders+receivers sum up to cores == 4 --- .../src/jmh/kotlin/benchmarks/ChannelBenchmark.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt index 52f6c78863..a00b706cef 100644 --- a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -55,12 +55,12 @@ open class ChannelBenchmark { @Benchmark fun oneSenderManyReceivers() = runBlocking { - runSendReceive(count, Channel.UNLIMITED, 1, cores) + runSendReceive(count, Channel.UNLIMITED, 1, cores - 1) } @Benchmark fun manySendersOneReceiver() = runBlocking { - runSendReceive(count, Channel.UNLIMITED, cores, 1) + runSendReceive(count, Channel.UNLIMITED, cores - 1, 1) } @Benchmark @@ -83,10 +83,10 @@ open class ChannelBenchmark { // NB: not all parameter combinations make sense in general. // E.g., for the rendezvous channel, senders should be equal to receivers. // If they are non-equal, it's a special case of performance under contention. - private suspend inline fun runSendReceive(count: Int, capacity: Int, senders: Int = 1, receivers: Int = 1) = + private suspend inline fun runSendReceive(count: Int, capacity: Int, senders: Int = 1, receivers: Int = 1) { + require(senders > 0 && receivers > 0) + require(senders + receivers <= cores) withContext(Dispatchers.Default) { - require(senders > 0 && receivers > 0) - val channel = Channel(capacity) repeat(receivers) { launch { @@ -103,4 +103,5 @@ open class ChannelBenchmark { } channel.close() } + } } From bf9af79f5fa96c614d28ae204026e7c3c578b1ca Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Tue, 4 Nov 2025 11:51:24 +0000 Subject: [PATCH 05/12] add prefill --- .../jmh/kotlin/benchmarks/ChannelBenchmark.kt | 69 ++++++++++++++----- 1 file changed, 53 insertions(+), 16 deletions(-) diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt index a00b706cef..8a68b0ab0a 100644 --- a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -22,10 +22,34 @@ open class ChannelBenchmark { // 1. Preallocate. // 2. Different values to avoid helping the cache. - val list = ArrayList(100000000).apply { - repeat(100000000) { add(it) } + val maxCount = 100000000 + val list = ArrayList(maxCount).apply { + repeat(maxCount) { add(it) } } + @State(Scope.Benchmark) + open class UnlimitedChannelWrapper { + // 0, 4 MB, 40 MB, 400 MB + @Param("0", "1000000", "10000000", "100000000") + private var prefill = 0 + + lateinit var channel: Channel + + val maxCount = 100000000 + val list = ArrayList(maxCount).apply { + repeat(maxCount) { add(it) } + } + + @Setup(Level.Invocation) + fun createPrefilledChannel() { + channel = Channel(Channel.UNLIMITED) + repeat(prefill) { + channel.trySend(list[it]) + } + } + } + + @Benchmark fun sendUnlimited() = runBlocking { runSend(count, Channel.UNLIMITED) @@ -37,35 +61,35 @@ open class ChannelBenchmark { } @Benchmark - fun sendReceiveUnlimited() = runBlocking(Dispatchers.Default) { - runSendReceive(count, Channel.UNLIMITED) + fun sendReceiveUnlimited(wrapper: UnlimitedChannelWrapper) = runBlocking(Dispatchers.Default) { + runSendReceive(wrapper.channel, count) } @Benchmark fun sendReceiveConflated() = runBlocking(Dispatchers.Default) { - runSendReceive(count, Channel.CONFLATED) + runSendReceive(Channel(Channel.CONFLATED), count) } @Benchmark fun sendReceiveRendezvous() = runBlocking(Dispatchers.Default) { // NB: Rendezvous is partly benchmarking the scheduler, not the channel alone. // So don't trust the Rendezvous results too much. - runSendReceive(count, Channel.RENDEZVOUS) + runSendReceive(Channel(Channel.RENDEZVOUS), count) } @Benchmark - fun oneSenderManyReceivers() = runBlocking { - runSendReceive(count, Channel.UNLIMITED, 1, cores - 1) + fun oneSenderManyReceivers(wrapper: UnlimitedChannelWrapper) = runBlocking { + runSendReceive(wrapper.channel, count, 1, cores - 1) } @Benchmark - fun manySendersOneReceiver() = runBlocking { - runSendReceive(count, Channel.UNLIMITED, cores - 1, 1) + fun manySendersOneReceiver(wrapper: UnlimitedChannelWrapper) = runBlocking { + runSendReceive(wrapper.channel, count, cores - 1, 1) } @Benchmark - fun manySendersManyReceivers() = runBlocking { - runSendReceive(count, Channel.UNLIMITED, cores / 2, cores / 2) + fun manySendersManyReceivers(wrapper: UnlimitedChannelWrapper) = runBlocking { + runSendReceive(wrapper.channel, count, cores / 2, cores / 2) } private suspend fun sendManyItems(count: Int, channel: Channel) = coroutineScope { @@ -83,21 +107,34 @@ open class ChannelBenchmark { // NB: not all parameter combinations make sense in general. // E.g., for the rendezvous channel, senders should be equal to receivers. // If they are non-equal, it's a special case of performance under contention. - private suspend inline fun runSendReceive(count: Int, capacity: Int, senders: Int = 1, receivers: Int = 1) { + private suspend inline fun runSendReceive(channel: Channel, count: Int, senders: Int = 1, receivers: Int = 1) { require(senders > 0 && receivers > 0) + // Can be used with more than num cores but needs thinking it through, + // e.g., what would it measure? require(senders + receivers <= cores) + // if the channel is prefilled, do not consume the prefilled items + val consumeAll = channel.isEmpty + // send almost `count` items, up to `senders - 1` items will not be sent (negligible) + val countPerSender = count / senders + // for prefilled channel only: up to `receivers - 1` items of the sent items will not be received (negligible) + val countPerReceiverAtLeast = countPerSender * senders / receivers withContext(Dispatchers.Default) { - val channel = Channel(capacity) repeat(receivers) { launch { - channel.consumeEach { } + if (consumeAll) { + channel.consumeEach { } + } else { + repeat(countPerReceiverAtLeast) { + channel.receive() + } + } } } coroutineScope { repeat(senders) { launch { - sendManyItems(count / senders, channel) + sendManyItems(countPerSender, channel) } } } From c406fbd6d65e9bdd7854ec4f51825b7267664bd2 Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Tue, 4 Nov 2025 11:52:26 +0000 Subject: [PATCH 06/12] remove Dispatchers.Default, it's it the runSendReceive already --- benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt index 8a68b0ab0a..96d72aeba5 100644 --- a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -61,7 +61,7 @@ open class ChannelBenchmark { } @Benchmark - fun sendReceiveUnlimited(wrapper: UnlimitedChannelWrapper) = runBlocking(Dispatchers.Default) { + fun sendReceiveUnlimited(wrapper: UnlimitedChannelWrapper) = runBlocking { runSendReceive(wrapper.channel, count) } From 84255616ae869006b56832072d8c6dab046bbd8f Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Tue, 4 Nov 2025 11:55:42 +0000 Subject: [PATCH 07/12] sendManyItems simplify and comment --- benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt index 96d72aeba5..b474fa0333 100644 --- a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -92,9 +92,10 @@ open class ChannelBenchmark { runSendReceive(wrapper.channel, count, cores / 2, cores / 2) } - private suspend fun sendManyItems(count: Int, channel: Channel) = coroutineScope { - for (i in 1..count) { - channel.send(list[i]) + private suspend fun sendManyItems(count: Int, channel: Channel) { + repeat(count) { + // NB: it is `send`, not `trySend`, on purpose, since we are testing the `send` performance here. + channel.send(list[it]) } } From be3f273ee2712770eda6174bd7f5821b4cdb6595 Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Tue, 4 Nov 2025 12:01:17 +0000 Subject: [PATCH 08/12] replace consume with receive --- .../src/jmh/kotlin/benchmarks/ChannelBenchmark.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt index b474fa0333..d40425c97c 100644 --- a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -105,6 +105,12 @@ open class ChannelBenchmark { } } + suspend fun Channel.forEach(action: (E) -> Unit) { + for (element in this) { + action(element) + } + } + // NB: not all parameter combinations make sense in general. // E.g., for the rendezvous channel, senders should be equal to receivers. // If they are non-equal, it's a special case of performance under contention. @@ -113,8 +119,8 @@ open class ChannelBenchmark { // Can be used with more than num cores but needs thinking it through, // e.g., what would it measure? require(senders + receivers <= cores) - // if the channel is prefilled, do not consume the prefilled items - val consumeAll = channel.isEmpty + // if the channel is prefilled, do not receive the prefilled items + val receiveAll = channel.isEmpty // send almost `count` items, up to `senders - 1` items will not be sent (negligible) val countPerSender = count / senders // for prefilled channel only: up to `receivers - 1` items of the sent items will not be received (negligible) @@ -122,8 +128,8 @@ open class ChannelBenchmark { withContext(Dispatchers.Default) { repeat(receivers) { launch { - if (consumeAll) { - channel.consumeEach { } + if (receiveAll) { + channel.forEach { } } else { repeat(countPerReceiverAtLeast) { channel.receive() From b5c7bf7bdf4b9225237528b15aa8e3efd2b6a973 Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Tue, 4 Nov 2025 13:42:21 +0000 Subject: [PATCH 09/12] change units from ms to ns --- benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt index d40425c97c..a0cccdd47e 100644 --- a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -8,7 +8,7 @@ import java.util.concurrent.* @Warmup(iterations = 7, time = 1) @Measurement(iterations = 10, time = 1) @BenchmarkMode(Mode.AverageTime) -@OutputTimeUnit(TimeUnit.MILLISECONDS) +@OutputTimeUnit(TimeUnit.NANOSECONDS) @State(Scope.Benchmark) @Fork(1) open class ChannelBenchmark { From f82a49333222df716467224561bff8e159694ad6 Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Thu, 6 Nov 2025 11:21:15 +0000 Subject: [PATCH 10/12] fix --- .../jmh/kotlin/benchmarks/ChannelBenchmark.kt | 46 ++++++++----------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt index a0cccdd47e..6415745f3e 100644 --- a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -14,7 +14,7 @@ import java.util.concurrent.* open class ChannelBenchmark { // max coroutines launched per benchmark // to allow for true parallelism - val cores = 4 + val cores = Runtime.getRuntime().availableProcessors() // 4 KB, 40 KB, 400 KB, 4 MB, 40 MB, 400 MB @Param("1000", "10000", "100000", "1000000", "10000000", "100000000") @@ -22,10 +22,7 @@ open class ChannelBenchmark { // 1. Preallocate. // 2. Different values to avoid helping the cache. - val maxCount = 100000000 - val list = ArrayList(maxCount).apply { - repeat(maxCount) { add(it) } - } + val list = List(100000000) { it } @State(Scope.Benchmark) open class UnlimitedChannelWrapper { @@ -35,10 +32,7 @@ open class ChannelBenchmark { lateinit var channel: Channel - val maxCount = 100000000 - val list = ArrayList(maxCount).apply { - repeat(maxCount) { add(it) } - } + val list = List(100000000) { it } @Setup(Level.Invocation) fun createPrefilledChannel() { @@ -92,19 +86,13 @@ open class ChannelBenchmark { runSendReceive(wrapper.channel, count, cores / 2, cores / 2) } - private suspend fun sendManyItems(count: Int, channel: Channel) { + private suspend fun runSend(count: Int, capacity: Int) { + val channel = Channel(capacity) repeat(count) { - // NB: it is `send`, not `trySend`, on purpose, since we are testing the `send` performance here. channel.send(list[it]) } } - private suspend fun runSend(count: Int, capacity: Int) { - Channel(capacity).also { - sendManyItems(count, it) - } - } - suspend fun Channel.forEach(action: (E) -> Unit) { for (element in this) { action(element) @@ -115,25 +103,27 @@ open class ChannelBenchmark { // E.g., for the rendezvous channel, senders should be equal to receivers. // If they are non-equal, it's a special case of performance under contention. private suspend inline fun runSendReceive(channel: Channel, count: Int, senders: Int = 1, receivers: Int = 1) { - require(senders > 0 && receivers > 0) - // Can be used with more than num cores but needs thinking it through, - // e.g., what would it measure? - require(senders + receivers <= cores) - // if the channel is prefilled, do not receive the prefilled items + //require (senders > 0 && receivers > 0) + //require (senders + receivers <= cores) // Can be used with more than num cores, but what would it measure? + // if the channel is prefilled, only receive the items that were sent by this function val receiveAll = channel.isEmpty // send almost `count` items, up to `senders - 1` items will not be sent (negligible) val countPerSender = count / senders - // for prefilled channel only: up to `receivers - 1` items of the sent items will not be received (negligible) + // for prefilled channel only: up to `receivers - 1` items of the sent items will not be received + // (on top of the prefilled items which we do not aim to receive at all) (negligible) val countPerReceiverAtLeast = countPerSender * senders / receivers withContext(Dispatchers.Default) { repeat(receivers) { launch { if (receiveAll) { - channel.forEach { } + channel.forEach { + // possibly receive into the blackhole + } } else { repeat(countPerReceiverAtLeast) { - channel.receive() - } + // possibly receive into the blackhole + channel.receive() + } } } } @@ -141,7 +131,9 @@ open class ChannelBenchmark { coroutineScope { repeat(senders) { launch { - sendManyItems(countPerSender, channel) + repeat(countPerSender) { + channel.send(list[it]) + } } } } From 939c1d58cce6a62c3798f7262d012540fd02a108 Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Thu, 6 Nov 2025 11:23:45 +0000 Subject: [PATCH 11/12] attempt to align comment on top of @Param --- benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt index 6415745f3e..244e7680ab 100644 --- a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -17,7 +17,7 @@ open class ChannelBenchmark { val cores = Runtime.getRuntime().availableProcessors() // 4 KB, 40 KB, 400 KB, 4 MB, 40 MB, 400 MB - @Param("1000", "10000", "100000", "1000000", "10000000", "100000000") + @Param(value = ["1000", "10000", "100000", "1000000", "10000000", "100000000"]) var count: Int = 0 // 1. Preallocate. From 4647c520026c78a05c56be757c855c7fff8e6dcc Mon Sep 17 00:00:00 2001 From: Natasha Murashkina Date: Thu, 6 Nov 2025 12:33:01 +0000 Subject: [PATCH 12/12] align another entry --- benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt index 244e7680ab..16e3b46164 100644 --- a/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/benchmarks/ChannelBenchmark.kt @@ -27,7 +27,7 @@ open class ChannelBenchmark { @State(Scope.Benchmark) open class UnlimitedChannelWrapper { // 0, 4 MB, 40 MB, 400 MB - @Param("0", "1000000", "10000000", "100000000") + @Param(value = ["0", "1000000", "10000000", "100000000"]) private var prefill = 0 lateinit var channel: Channel