beyla icon indicating copy to clipboard operation
beyla copied to clipboard

Optimize Go object allocation

Open grcevski opened this issue 1 year ago • 1 comments

I made a few changes to reduce the amount of transient memory we allocate. With this change, the majority of allocations are out of our control. Very little is in the ring buffer path, the rest are all about working with the SDKs to generate metrics and traces.

pprof after the changes

profile (1).pb.gz

grcevski avatar Jul 17 '24 00:07 grcevski

Codecov Report

Attention: Patch coverage is 87.14286% with 9 lines in your changes missing coverage. Please review.

Project coverage is 81.69%. Comparing base (27dc018) to head (3f559a9).

Files Patch % Lines
pkg/internal/infraolly/process/snapshot.go 0.00% 5 Missing and 1 partial :warning:
pkg/internal/export/alloy/traces.go 0.00% 0 Missing and 1 partial :warning:
pkg/internal/export/otel/metrics.go 0.00% 0 Missing and 1 partial :warning:
pkg/internal/export/prom/prom.go 80.00% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1028      +/-   ##
==========================================
+ Coverage   81.68%   81.69%   +0.01%     
==========================================
  Files         137      137              
  Lines       10923    10948      +25     
==========================================
+ Hits         8922     8944      +22     
- Misses       1494     1497       +3     
  Partials      507      507              
Flag Coverage Δ
integration-test 56.28% <67.14%> (-0.10%) :arrow_down:
k8s-integration-test 59.10% <54.28%> (+0.03%) :arrow_up:
oats-test 37.36% <50.00%> (+0.02%) :arrow_up:
unittests 51.09% <45.71%> (+0.07%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jul 17 '24 01:07 codecov-commenter