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

Support better profiling in bench #2624

Open
kernelmachine opened this issue Apr 27, 2016 · 12 comments
Open

Support better profiling in bench #2624

kernelmachine opened this issue Apr 27, 2016 · 12 comments
Labels
A-new-subcommand Area: new subcommand Command-bench S-triage Status: This issue is waiting on initial triage.

Comments

@kernelmachine
Copy link

I find myself jumping between cargo bench and valgrind/perf a lot. It would be great if bench supported better profiling.

If this is something that interests the team, would it be better to implement this as something that talks to existing profilers, or sandbox the code directly? Could start out with basic information like what's available in perf stat.

@kernelmachine kernelmachine changed the title Improve profiling in bench Support better profiling in bench Apr 27, 2016
@alexcrichton alexcrichton added the A-new-subcommand Area: new subcommand label Apr 27, 2016
@alexcrichton
Copy link
Member

Thanks for the report! We've often thought that a specific workflow around profiling would be nice to have in Cargo, although a cross-platform story is pretty difficult unfortunately :(

I suspect that this may best be done growing as a separate subcommand for now, and if it turns out well we can merge it back in.

@kernelmachine
Copy link
Author

Great, sounds good! Will get on it and circle back soon.

@kernelmachine
Copy link
Author

kernelmachine commented Apr 27, 2016

just started some work here: https://github.com/pegasos1/cargo-profiler

Right now I plan on gathering information with multiple linux-based profiling tools, presenting info in most user-friendly way possible. Any other basic statistics we can easily implement. We can expand from there based on interest. Sound good?

@kernelmachine
Copy link
Author

It would also be cool to be able to profile individual functions with #[profile] attribute

@alexcrichton
Copy link
Member

Awesome! Sounds good to me!

@kernelmachine
Copy link
Author

Hey Alex, check out the project so far: https://github.com/pegasos1/cargo-profiler

I'm still improving some aspects of the code, but version 1 is almost complete. You can see some example output in the README. Actual output is colored. Let me know if you have any initial feedback.

@alexcrichton
Copy link
Member

Nice! That looks pretty slick. You could even recommend cargo install --git in the README :)

I wonder if we can help out valgrind to demangle symbols wherever possible as well

@kernelmachine
Copy link
Author

thanks! will add that in.

Good idea. I'm pretty sure that just means removing "$*$" and everything past the last "::", but i'll have to make sure there aren't any weird edge cases.

@kernelmachine
Copy link
Author

Do you know if those symbols are a result of valgrind or rustc?

@alexcrichton
Copy link
Member

I believe they're all from the compiler, probably around impls and closures and such.

@kernelmachine
Copy link
Author

@epage epage added Command-bench S-triage Status: This issue is waiting on initial triage. labels Sep 28, 2023
@epage
Copy link
Contributor

epage commented Sep 28, 2023

While I feel we should make the workflow clearer for profiling, I'm not sure how we'd address the problem that users might want to use one of several profilers which also have different modes and OS support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-new-subcommand Area: new subcommand Command-bench S-triage Status: This issue is waiting on initial triage.
Projects
Status: No status
Development

No branches or pull requests

3 participants