Edoardo Luppi
08/27/2023, 3:38 PMBuffer
with an initial size?
I need to write quite some data, so an initial optimization would be good to haveFilipp Zhinkin
08/28/2023, 7:48 AMBuffer
doesn't have a fixed storage associated with it, instead, it consists of multiple small segments (8KB each, at the moment) and these segments are cached to avoid frequent allocations and reduce the latency of adding a new one to the buffer (but the cache exists only on JVM target and its size is relatively small).
If you're experiencing performance issues related to how the buffer's storage is managed, feel free to file an issue (https://github.com/Kotlin/kotlinx-io/issues) and we'll see what could be done.Edoardo Luppi
08/28/2023, 7:51 AMEdoardo Luppi
08/28/2023, 7:53 AMFilipp Zhinkin
08/28/2023, 8:00 AMEdoardo Luppi
08/28/2023, 11:03 AMEdoardo Luppi
08/28/2023, 11:09 AM