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

[PROF-9476] Managed string storage for interning over several profiles #414

Closed
wants to merge 1 commit into from

Conversation

AlexJF
Copy link
Contributor

@AlexJF AlexJF commented May 6, 2024

What does this PR do?

PoC for allowing string interning to survive across several profiles. This is used in DataDog/dd-trace-rb#3628 to reduce the overhead of heap profiling.

THIS CODE IS NOT PRODUCTION READY AND IS SIMPLY A HACKISH PoC!

Motivation

Heap profiling is a stateful mode of profiling where samples associated with live objects may be emitted across several profiles (those where the live object stays alive). Because of this, information such as the allocation class and allocation stacktrace needs to be preserved alongside the tracked object so heap samples can be re-inserted in subsequent profiles.

libdatadog already does a good job of handling and deduplicating strings in the span of a single profile. Exposing an API to allow doing this work across several profiles would prevent users from having to re-implement this outside of libdatadog and duplicating a lot of work.

Initial testing with dd-trace-rb shows great promise, allowing us to increase heap sampling rate by 10x with negligible overhead compared to the currently released implementation:

image image

Additional Notes

Anything else we should know when reviewing?

How to test the change?

Describe here in detail how the change can be validated.

For Reviewers

  • If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. To override this behavior, add the keep-open label or update the PR.

@github-actions github-actions bot added the stale Used by actions/stale to identify PRs that have been inactive for 90+ days label Oct 23, 2024
@ivoanjo ivoanjo added keep-open Overrides actions/stale auto-closing stale PRs and removed stale Used by actions/stale to identify PRs that have been inactive for 90+ days labels Oct 24, 2024
@ivoanjo
Copy link
Member

ivoanjo commented Oct 24, 2024

I've added keep-open for this one, as I plan to pick it up soon ™️

@ivoanjo
Copy link
Member

ivoanjo commented Nov 5, 2024

Closing in favor of #607

@ivoanjo ivoanjo closed this Nov 5, 2024
@ivoanjo ivoanjo self-assigned this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build keep-open Overrides actions/stale auto-closing stale PRs profiling Relates to the profiling* modules.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants