Skip to content

CSHARP-5531: Optimize the conversion from an array index to UTF-8 byte arrays #1672

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

Closed
wants to merge 3 commits into from

Conversation

dear-gary
Copy link
Contributor

  1. Use Utf8Formatter.TryFormat API to avoid string allocations and write directly to a reused byte[]
  2. Define a byte[] member in BsonBinaryWriter class and reuse it to avoid byte[] allocations

seeCSHARP-5531 for more details

@dear-gary dear-gary requested a review from a team as a code owner April 16, 2025 09:40
@dear-gary dear-gary requested review from JamesKovacs and removed request for a team April 16, 2025 09:40
@BorisDog
Copy link
Contributor

BorisDog commented May 1, 2025

Thanks @dear-gary for this PR.
We'll be evaluating such allocations improvements in the serialization area in the scope of CSHARP-5575 in the upcoming quarter.
Closing this PR, as we plan to address this as part of a larger effort in Q2.

@BorisDog BorisDog closed this May 1, 2025
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