Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: reader memory reuse improvements #32

Closed
wants to merge 1 commit into from

Conversation

ianprime0509
Copy link
Owner

The intention is for this PR to address both #30 and #31 so some real benefits can be realized. Just implementing #30 by itself without any meaningful change to Reader to take advantage of the increased flexibility provides no benefit.

Closes #30

This currently provides no benefit in itself based on my benchmarks, but
opens the door to further performance opportunities for `Reader`.

Since `TokenReader`'s buffer is now allowed to grow, it is no longer
necessary for the decoder interface to handle overflowing the encoding
buffer. As such, the parameter type of the buffer has been changed to
reflect the exact necessary size, and `error.Overflow` is no longer
returned.

BREAKING CHANGE: `TokenReader` now requires an allocator, and
`error.Overflow` is no longer returned from any reader function.
@ianprime0509
Copy link
Owner Author

Superseded by #36.

@ianprime0509 ianprime0509 deleted the token-reader-allocator branch September 15, 2024 00:52
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