Skip to content

Use array-backed buffer for incoming messages in 'StreamIngest'#819

Open
seigert wants to merge 2 commits intotypelevel:mainfrom
seigert:stream-ingest-buffer
Open

Use array-backed buffer for incoming messages in 'StreamIngest'#819
seigert wants to merge 2 commits intotypelevel:mainfrom
seigert:stream-ingest-buffer

Conversation

@seigert
Copy link
Contributor

@seigert seigert commented Dec 15, 2025

If value of prefetchN option set for client- or server-side streaming calls is bigger than some arbitrary threshold, fs2.Chunk.ArraySlice will be used for incoming messages with shared array buffer underneath.

Currently threshold is set to prefetchN == 14 so that minimal size of array is 128 bytes (12 + 4 + 14 * 8) for 'CompressedOops' pointers.

Some benchmarks are needed to check if this optimisation is worthy of involved code complexity.

Accumilated buffer will be converted to a `fs2.Chunk[T]` before emitting
of stream messages.
@seigert seigert force-pushed the stream-ingest-buffer branch from a069189 to dd7ad03 Compare December 15, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant