-
Notifications
You must be signed in to change notification settings - Fork 293
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
Leverage modern .NET features for improved perf. #803
Conversation
|
I signed the CLA, but it's still showing as missing. Maybe there's latency there, or maybe something is messed up... |
@geeknoid, if we speaking about CLA - please check if your email assigned to the commit is the same as you have assigned to you GitHub account. It is the most common issue I have seen here. |
src/OpenTelemetry.Exporter.Geneva/MsgPackExporter/MessagePackSerializer.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks @geeknoid
I've filed a support ticket with the EasyCLA folks regarding the fact even though I accepted the CLA, their bot is not happy about it. Hopefully, that'll be resolved soon. |
src/OpenTelemetry.Exporter.Geneva/OpenTelemetry.Exporter.Geneva.csproj
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can share more code between .NET Standard 2.0 and .NET 6 if you:
- Use the
System.Memory
package in .NET Standard 2.0 (still multi-target to avoid the reference on .NET 6). It also bringsBinaryPrimitives
downlevel. - Add an extension method on
Encoding.GetBytes
that takes spans, whose implementation pins them and calls the pointer overload.
- When serializing objects, recognize ISpanFormattable on .NET 6 to avoid a temp string allocation in that case. - Use binary primitives to serialize scalar types more efficiently, avoiding repeated bound checks.
OK, CLA issue is resolved. Now I just need to get the coverage to pass :-) |
That's a flaky test and it's not a required check. Thanks for your contribution @geeknoid ! |
Changes
When serializing objects, recognize ISpanFormattable on .NET 6 in order to avoid a temp string allocation in that case.
Use binary primitives to serialize scalar types more efficiently (avoiding repeated bound checks).