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

ddtrace/tracer: Memoize the PID #438

Merged
merged 2 commits into from
May 16, 2019
Merged

ddtrace/tracer: Memoize the PID #438

merged 2 commits into from
May 16, 2019

Conversation

CAFxX
Copy link
Contributor

@CAFxX CAFxX commented May 15, 2019

The os.Getpid() call is visible in profile flamegraphs of busy servers.
Memoize it as the PID won't change in the lifetime of a Go process.

The os.Getpid() call is visible in profile flamegraphs of busy servers.
Memoize it as the PID won't change in the lifetime of a Go process.
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Found some fixes!

P.S. share your ideas, feedbacks or issues with us at https://github.com/fixmie/feedback (this message will be removed after the beta stage).

Co-Authored-By: fixmie[bot] <fixmie[bot]@users.noreply.github.com>
@cgilmour cgilmour changed the title Memoize the PID ddtrace/tracer: Memoize the PID May 16, 2019
Copy link
Contributor

@cgilmour cgilmour left a comment

Choose a reason for hiding this comment

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

Makes sense, looks good and passes the existing tests related to the pid tag.

@cgilmour
Copy link
Contributor

Thanks for providing this optimization.

Could you take a look at the contribution guidelines, and in the future, consider opening an issue to discuss changes first.

@gbbr any action required for the Fixmie error, or is it a CI flake?

@gbbr
Copy link
Contributor

gbbr commented May 16, 2019

Thank you both! This is a good change!

@gbbr gbbr merged commit f3fe6e5 into DataDog:v1 May 16, 2019
@gbbr
Copy link
Contributor

gbbr commented May 16, 2019

Unsure about CI. It says "Internal error" 😴

@gbbr
Copy link
Contributor

gbbr commented May 17, 2019

@CAFxX would you mind helping out the fixmie project by answering this question: fixmie/feedback#11 (comment) ?

@CAFxX CAFxX deleted the patch-1 branch May 17, 2019 09:35
@CAFxX
Copy link
Contributor Author

CAFxX commented May 17, 2019

Commented

mingrammer pushed a commit to mingrammer/dd-trace-go that referenced this pull request Dec 22, 2020
The os.Getpid() call is visible in profile flamegraphs of busy servers.
Memoize it as the PID won't change in the lifetime of a Go process.
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.

3 participants