1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-04-09 02:10:10 +08:00

Change common ByteArrayPool to 128 * 4096

This commit is contained in:
Him188 2022-06-02 16:59:59 +01:00
parent 419f373189
commit 1f5493ba97
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375

View File

@ -14,11 +14,11 @@ import io.ktor.utils.io.pool.*
/**
* 缓存 [ByteArray] 实例的 [ObjectPool]
*/
public object ByteArrayPool : DefaultPool<ByteArray>(256) {
public object ByteArrayPool : DefaultPool<ByteArray>(128) {
/**
* 每一个 [ByteArray] 的大小
*/
public const val BUFFER_SIZE: Int = 8192 * 8
public const val BUFFER_SIZE: Int = 4096
override fun produceInstance(): ByteArray = ByteArray(BUFFER_SIZE)