Skip to content

Use dupIO to avoid unwanted sharing when encoding #321

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

adamgundry
Copy link
Member

@adamgundry adamgundry commented May 24, 2023

This introduces an optional dependency on dupIO for use when encoding, to avoid unwanted sharing as described at #318. (See #319 for an alternative approach adding a new token constructor.) I've also incorporated a fix to #317, though this doesn't seem to make a massive difference to encoding performance.

It calls dupIO before evaluating each token in the stream. Originally I tried calling dupIO only once the buffer was full, but testing the approach on the client's codebase indicated that this was not enough to avoid the issue.

Since it is unclear how much performance cost dupIO incurs in general, and it may be undesirable as a dependency, it is gated behind an off-by-default flag. (This raises the question of how to test it in CI...)

@adamgundry adamgundry changed the title WIP: experimentally use dupIO (take 2) Use dupIO to avoid unwanted sharing when encoding Mar 18, 2025
This calls dupIO before evaluating each token in the token stream.
@adamgundry adamgundry marked this pull request as ready for review March 26, 2025 11: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