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

Low allocation OTLP logs marshaler #6429

Merged

Conversation

jack-berg
Copy link
Member

Continuation of #6410, #6422

Benchmark                                                              Mode  Cnt     Score    Error   Units
LogsRequestMarshalerBenchmark.marshalStateful                          avgt   10     1.213 ±  0.013   us/op
LogsRequestMarshalerBenchmark.marshalStateful:gc.alloc.rate            avgt   10  2359.345 ± 24.972  MB/sec
LogsRequestMarshalerBenchmark.marshalStateful:gc.alloc.rate.norm       avgt   10  3000.001 ±  0.001    B/op
LogsRequestMarshalerBenchmark.marshalStateful:gc.count                 avgt   10    40.000           counts
LogsRequestMarshalerBenchmark.marshalStateful:gc.time                  avgt   10    19.000               ms
LogsRequestMarshalerBenchmark.marshalStatefulJson                      avgt   10     3.598 ±  0.067   us/op
LogsRequestMarshalerBenchmark.marshalStatefulJson:gc.alloc.rate        avgt   10  1520.504 ± 28.543  MB/sec
LogsRequestMarshalerBenchmark.marshalStatefulJson:gc.alloc.rate.norm   avgt   10  5736.002 ±  0.001    B/op
LogsRequestMarshalerBenchmark.marshalStatefulJson:gc.count             avgt   10    25.000           counts
LogsRequestMarshalerBenchmark.marshalStatefulJson:gc.time              avgt   10    12.000               ms
LogsRequestMarshalerBenchmark.marshalStateless                         avgt   10     1.325 ±  0.014   us/op
LogsRequestMarshalerBenchmark.marshalStateless:gc.alloc.rate           avgt   10    51.798 ±  0.552  MB/sec
LogsRequestMarshalerBenchmark.marshalStateless:gc.alloc.rate.norm      avgt   10    72.001 ±  0.001    B/op
LogsRequestMarshalerBenchmark.marshalStateless:gc.count                avgt   10     1.000           counts
LogsRequestMarshalerBenchmark.marshalStateless:gc.time                 avgt   10     1.000               ms
LogsRequestMarshalerBenchmark.marshalStatelessJson                     avgt   10     3.487 ±  0.092   us/op
LogsRequestMarshalerBenchmark.marshalStatelessJson:gc.alloc.rate       avgt   10   485.766 ± 12.691  MB/sec
LogsRequestMarshalerBenchmark.marshalStatelessJson:gc.alloc.rate.norm  avgt   10  1776.002 ±  0.001    B/op
LogsRequestMarshalerBenchmark.marshalStatelessJson:gc.count            avgt   10     8.000           counts
LogsRequestMarshalerBenchmark.marshalStatelessJson:gc.time             avgt   10     4.000               ms

@jack-berg jack-berg requested a review from a team as a code owner May 3, 2024 20:45
@jack-berg
Copy link
Member Author

cc @laurit

Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 85.21401% with 38 lines in your changes are missing coverage. Please review.

Project coverage is 90.84%. Comparing base (414cc7b) to head (613e31c).
Report is 3 commits behind head on main.

Files Patch % Lines
...rnal/otlp/AttributeKeyValueStatelessMarshaler.java 72.72% 6 Missing and 6 partials ⚠️
...rter/internal/otlp/logs/LogStatelessMarshaler.java 82.60% 8 Missing and 4 partials ⚠️
...rter/internal/otlp/AnyValueStatelessMarshaler.java 89.74% 2 Missing and 2 partials ⚠️
...otlp/AttributeArrayAnyValueStatelessMarshaler.java 76.47% 2 Missing and 2 partials ⚠️
...l/otlp/logs/LowAllocationLogsRequestMarshaler.java 76.47% 3 Missing and 1 partial ⚠️
...rter/internal/otlp/KeyValueStatelessMarshaler.java 77.77% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6429      +/-   ##
============================================
- Coverage     90.85%   90.84%   -0.02%     
- Complexity     6028     6080      +52     
============================================
  Files           651      660       +9     
  Lines         17729    17928     +199     
  Branches       1777     1787      +10     
============================================
+ Hits          16107    16286     +179     
- Misses         1105     1118      +13     
- Partials        517      524       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +31 to +32
byte[] bytes = new byte[value.remaining()];
value.get(bytes);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, if needed, we could probably get rid of allocating a new byte array here.

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.

None yet

2 participants