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

Allow serializing BSON to a binary stream #525

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mccullocht
Copy link

No description provided.

@abr-egn
Copy link
Contributor

abr-egn commented Apr 2, 2025

I'm pretty hesitant about this approach - it adds a lot of complexity to serialization (which is already overdrawn on the complexity budget) for a relatively narrow use case, and it also seems likely to be a significant performance hit because of the double serialization required for the length calculation.

I'm assuming your current approach is to use bson::to_vec and then write that into the destination buffer via bytes::BufMut::put - has profiling shown the allocation or copy there to be substantial cost?

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.

2 participants