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

CSHARP-5125 Span support for ObjectId ctor, Parse, TryParse, BsonUtils hex conversion #1465

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Kloizdena
Copy link

  • Eliminated unneeded allocations from Parse and ToString()
  • Added Span overloads for ctor, Parse, TryParse, ToHexChars, ToByteSpan methods.

Local benchmark results:

Method Mean Error StdDev Gen0 Allocated
ToString_Original 33.47 ns 2.004 ns 5.877 ns 0.0172 144 B
ToString_New 35.48 ns 0.713 ns 0.792 ns 0.0086 72 B
Parse_Original 33.72 ns 0.699 ns 0.546 ns 0.0048 40 B
Parse_New 26.23 ns 0.547 ns 1.311 ns - -

@Kloizdena Kloizdena requested a review from a team as a code owner September 26, 2024 19:00
@Kloizdena Kloizdena requested review from BorisDog and removed request for a team September 26, 2024 19:00
@BorisDog
Copy link
Contributor

Thanks @Kloizdena for your PR.
CSHARP-5125 is not a priority in the upcoming quarter. We will consider this PR when CSHARP-5125 gets scheduled as part of our serialization improvement effort.

@BorisDog BorisDog removed their request for review October 22, 2024 23:32
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