Increase to default buffer size to 64
diff --git a/kotlinx-coroutines-core/common/src/channels/Channel.kt b/kotlinx-coroutines-core/common/src/channels/Channel.kt
index a2a6da2..f13a15c 100644
--- a/kotlinx-coroutines-core/common/src/channels/Channel.kt
+++ b/kotlinx-coroutines-core/common/src/channels/Channel.kt
@@ -530,7 +530,7 @@
/**
* Requests buffered channel with a default buffer capacity in `Channel(...)` factory function --
* the `ArrayChannel` gets created with a default capacity.
- * This capacity is equal to 16 by default and can be overridden by setting
+ * This capacity is equal to 64 by default and can be overridden by setting
* [DEFAULT_BUFFER_PROPERTY_NAME] on JVM.
*/
public const val BUFFERED = -2
@@ -545,7 +545,7 @@
public const val DEFAULT_BUFFER_PROPERTY_NAME = "kotlinx.coroutines.channels.defaultBuffer"
internal val CHANNEL_DEFAULT_CAPACITY = systemProp(DEFAULT_BUFFER_PROPERTY_NAME,
- 16, 1, UNLIMITED - 1
+ 64, 1, UNLIMITED - 1
)
}
}
diff --git a/kotlinx-coroutines-core/common/test/flow/operators/BufferTest.kt b/kotlinx-coroutines-core/common/test/flow/operators/BufferTest.kt
index 0b1b208..b68e115 100644
--- a/kotlinx-coroutines-core/common/test/flow/operators/BufferTest.kt
+++ b/kotlinx-coroutines-core/common/test/flow/operators/BufferTest.kt
@@ -11,7 +11,7 @@
class BufferTest : TestBase() {
private val n = 50 // number of elements to emit for test
- private val defaultBufferSize = 16 // expected default buffer size (per docs)
+ private val defaultBufferSize = 64 // expected default buffer size (per docs)
// Use capacity == -1 to check case of "no buffer"
private fun checkBuffer(capacity: Int, op: suspend Flow<Int>.() -> Flow<Int>) = runTest {