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

Serialize tags/metrics in a single pass #1416

Merged
merged 1 commit into from
Apr 21, 2021
Merged

Conversation

kevingosse
Copy link
Collaborator

Tags and metrics were initially serialized in a single pass, and the count was back-patched at the end. This caused issues because the MessagePack map header has a variable size, so in some cases I ended up not allocating enough space. This was fixed by switching to a two-pass algorithm, with a performance hit: #996

I just realized that there's actually an API to write a fixed-size header, so I'm switching back to a single-pass algorithm. The existing unit test TagsListTests.Serialization verifies that it does not introduce any regression (I confirmed beforehand that the test still fails if I use MessagePackBinary.WriteMapHeader instead of MessagePackBinary.WriteMapHeaderForceMap32Block).

@kevingosse kevingosse requested a review from a team as a code owner April 20, 2021 13:37
@lucaspimentel lucaspimentel added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Apr 20, 2021
@kevingosse kevingosse merged commit bab4b18 into master Apr 21, 2021
@kevingosse kevingosse deleted the kevin/tags_serialization branch April 21, 2021 09:02
@andrewlock andrewlock added the type:performance Performance, speed, latency, resource usage (CPU, memory) label Apr 23, 2021
@andrewlock andrewlock added this to the 1.26.1 milestone Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:performance Performance, speed, latency, resource usage (CPU, memory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants