Skip to content

Conversation

@brunsgaard
Copy link
Contributor

This change adds a new encoder option, WithBlockSize, which allows users to specify a maximum uncompressed buffer size. When this limit is reached, writerBlock() is triggered (after the record is written to the internal buffer) to avoid excessive memory usage when writing large individual records.

This complements the existing blockLength threshold.

Fixes #537

We are running a version of this lib, that includes the commit in our current pipelines.

Copy link
Member

@nrwiersma nrwiersma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, could you add a test please.

@brunsgaard
Copy link
Contributor Author

Added a test and performed a bit of refactor, please have a look when you have time.

This change adds a new encoder option, `WithBlockSize`, which allows
users to specify a maximum uncompressed buffer size. When this limit is
reached, `writerBlock()` is triggered (after the record is written to
the internal buffer) to avoid excessive memory usage when writing large
individual records.

This complements the existing blockLength threshold.
@brunsgaard brunsgaard force-pushed the feat/maxBufSize branch 2 times, most recently from b952b25 to 20501b2 Compare May 26, 2025 09:49
@nrwiersma nrwiersma merged commit 0b62b47 into hamba:main May 26, 2025
23 of 29 checks passed
@brunsgaard brunsgaard deleted the feat/maxBufSize branch May 26, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

maxBufferedBytes in addition to blockLengh

2 participants