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

testing: show rusage statistics for benchmarks #24905

Open
LMMilewski opened this issue Apr 17, 2018 · 3 comments
Open

testing: show rusage statistics for benchmarks #24905

LMMilewski opened this issue Apr 17, 2018 · 3 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@LMMilewski
Copy link
Member

When optimizing CPU usage, it would be useful to get CPU usage information from Go benchmarks.

Could we add, where supported, getrusage calls before and after running each benchmark, in addition to wall-time?

I have no opinion about the API for requesting those statistics. Perhaps adding a -test.stats or -test.resources flag would work?
For example: -test.stats=utime,stime,maxrss.

This doesn't have to be rusage specific. For instance, it could be extended with statistics from the perf_event API at some point.

I could send a CL if this is a welcome change.

@davecheney
Copy link
Contributor

davecheney commented Apr 17, 2018 via email

@josharian
Copy link
Contributor

See also #21295

@LMMilewski
Copy link
Member Author

@davecheney could you clarify your recommendation?

I'm familiar with the execution tracer. I use it when it's a good match for what I want to do.
However, I'm not sure how I could easily use it to:

  • communicate performance improvements to others (e.g. in a CL description, on a performance dashboard, etc.), or
  • quickly compare multiple optimization ideas to see which one yields the best results, or
  • do multiple runs and process results with benchstat

To clarify, I'm proposing adding, to benchmark output, columns with rusage diffs for requested resources. That is, we would have, for example, user time ("utime/op") column next to "ns/op".

@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 18, 2018
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants