From 3bd78070d0ebc14291aa37fb19a3eaa27173321b Mon Sep 17 00:00:00 2001 From: Laszlo Hornyak Date: Thu, 25 Jul 2024 19:16:14 +0200 Subject: [PATCH] channel capacity changed to be a parameter of the benchmark Signed-off-by: Laszlo Hornyak --- .../coroutines/channels/ChannelOverheadBenchmark.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kroki-jmh/src/main/kotlin/io/github/kerubistan/kroki/benchmark/coroutines/channels/ChannelOverheadBenchmark.kt b/kroki-jmh/src/main/kotlin/io/github/kerubistan/kroki/benchmark/coroutines/channels/ChannelOverheadBenchmark.kt index 90cfe4b..d3e4318 100644 --- a/kroki-jmh/src/main/kotlin/io/github/kerubistan/kroki/benchmark/coroutines/channels/ChannelOverheadBenchmark.kt +++ b/kroki-jmh/src/main/kotlin/io/github/kerubistan/kroki/benchmark/coroutines/channels/ChannelOverheadBenchmark.kt @@ -15,9 +15,12 @@ open class ChannelOverheadBenchmark { @Param("0", "1", "2", "3", "4") var stepCount: Int = 0 + @Param("0", "1", "2", "3", "4") + var capacity: Int = 0 + @Benchmark fun run() = runBlocking { - val channel = produce(capacity = 16) { + val channel = produce(capacity = capacity) { repeat(1000_000) { send(it) }