-
Notifications
You must be signed in to change notification settings - Fork 397
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
Flamegraph cleanup #312
Merged
Merged
Flamegraph cleanup #312
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
godlygeek
force-pushed
the
flamegraph_cleanup
branch
from
February 4, 2023 04:10
45a45e4
to
db5d40f
Compare
godlygeek
force-pushed
the
flamegraph_cleanup
branch
from
February 4, 2023 08:10
db5d40f
to
f27c77e
Compare
Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Previously the old chart elements were just being hidden, not removed, which used extra memory and led to extra unnecessary white space being added at the bottom of the flame graph. We need to not only destroy the flame graph itself, but also any tool tips that have been created for it. The `destroy` method doesn't destroy these, and if we don't remove them ourselves then they can cause a horizontal scroll bar to appear if the window is resized so that the place where the tool tip was is now beyond the screen width. Since we're destroying the old chart and creating a new one, we don't need to adjust the width of the old one. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Because resizing internally creates a new chart, we need to select the correct element on that chart. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
This lays the ground work for us to reuse our flame graph generation tools across multiple different types of flame graphs. Every function and class deleted from `flamegraph.js` is added without any changes (other than maybe an `export`) to `flamegraph_common.js`. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Rather than basing the width of the flame graph on the width of the browser window, base it on the width of the div that we're drawing into. The width of the div that we're drawing into may change by the time we're done (because we may have added a scroll bar, shrinking the available width), so we also need to poke the flame graph to update its width after it has been drawn. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Also, add a `.gitattributes` file to tell `git` to stop displaying diffs for these files, since they're not human readable. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
This lays the ground work for us to create a new type of HTML report that doesn't include these static elements. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
This function is hit extremely heavily when generating flame graphs, so restructuring it to be a bit more efficient and adding a cache is enough to speed up flame graph generation by up to 30% in some cases. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
godlygeek
force-pushed
the
flamegraph_cleanup
branch
from
February 4, 2023 20:54
f27c77e
to
1c4688e
Compare
pablogsal
approved these changes
Feb 4, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix several flame graph bugs, and make some improvements to pave the way for us to introduce new types of flame graphs.