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

Add option to svg to rescale to a certain function #190

Open
Haroenv opened this issue Jan 29, 2022 · 3 comments
Open

Add option to svg to rescale to a certain function #190

Haroenv opened this issue Jan 29, 2022 · 3 comments

Comments

@Haroenv
Copy link

Haroenv commented Jan 29, 2022

If there's a specific part of the program you want to optimise, let's say a single function, you'll run the flame graph tool and that function will take a certain amount of time of the whole graph. If you then make an improvement, you'll be able to measure how much time has changed in that main function compared to the whole graph fairly easily.

However, it's likely that a certain operation didn't get done the same amount of times (eg. in the case of a server, you won't get the same amount of requests), but you'll still get the same ratio within that function.

What then becomes cumbersome is trying to find out how much impact a certain change has. Let's say you have the main function taking 43% in the first profile, and 49% in the next, but what you're trying to profile inside of that is 15% in the first and 14% in the second. You can tell it made an improvement.

What becomes hard is to know how large that improvement is relative to the "main" function, not the whole profile. It would be interesting that if you select a certain part of the trace, all child traces would (in brackets maybe?) have the ratio within the function which is currently focused too.

If there's already a way to get that info, I'm also very happy of course 👍

For now my workaround is calculating myself by dividing the number of samples of my optimised subfunction to the main function in both traces, which can give a percentage (583/1611, 36.19% in one and 538/1852, 29.05% in the other one).

@djc
Copy link
Contributor

djc commented Jan 29, 2022

flamegraph is basically a wrapper around the inferno library, which helps collect perf or dtrace data, then passes it to perf. I think this feature request is something that ought to be implemented in inferno (if it does not already exist).

@Haroenv
Copy link
Author

Haroenv commented Jan 30, 2022

Thanks, that makes sense. I opened jonhoo/inferno#228 instead!

@Haroenv Haroenv closed this as completed Jan 30, 2022
@djc djc reopened this Jan 30, 2022
@djc
Copy link
Contributor

djc commented Jan 30, 2022

I'll keep this open, if/once this is implemented in inferno we'll need to do some work on the CLI to forward the configuration.

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

No branches or pull requests

2 participants