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

Lazily initiate guid on DefaultTracer #2057

Closed
wants to merge 1 commit into from

Conversation

yuzawa-san
Copy link
Contributor

Before contributing, please read our contributing guidelines and code of conduct.

Overview

I was doing some flame graph analysis and noticed that every tracer had a guid created. However, it would appear that the guid is only really needed on demand if the trace is being reported on.

Here are the flame/icicle graphs of memory allocations from a simple Spring webflux app. Note the number of instances with byte[], char[], String, and DefaultTracer are most allocated.
image
image

Unrelated (for a different issue), the reactive streams instrumentation on spring boot creates an gigantic number of tracers. I'm thinking of ways to maybe cut down on that. Or maybe DefaultTracer/AbstractTracer could be make lighter (there are a lot of fields).

NOTE: does this need to be thread safe? I could add a lock or CAS, if you want.

Related Github Issue

none

Testing

Normal CI suite should pass. If you run flame chart analysis the additional memory allocations should disappear.

Checks

  • Your contributions are backwards compatible with relevant frameworks and APIs.
  • Your code does not contain any breaking changes. Otherwise please describe.
  • Your code does not introduce any new dependencies. Otherwise please describe.

@CLAassistant
Copy link

CLAassistant commented Sep 19, 2024

CLA assistant check
All committers have signed the CLA.

@kford-newrelic kford-newrelic added the oct-dec qtr Represents proposed work item for the Oct-Dec quarter label Sep 30, 2024
@jtduffy jtduffy self-assigned this Sep 30, 2024
@jtduffy jtduffy closed this in #2088 Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oct-dec qtr Represents proposed work item for the Oct-Dec quarter
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants