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

Speed-up flame graph generation by skipping unneeded work. #881

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

ghemawat
Copy link
Contributor

Previously, we used to call report.TextItems() during flame graph generation just so we could get a hand on the legend to print in the profile details box. All the work done by TextItems() to produce a trimmed graph was discarded.

This change separates out the legend generation into a separate routine so that we can avoid doing the unnecessary work.

Benchmark result:

name      old time/op  new time/op  delta
Flame-12   6.10s ± 3%   0.39s ± 4%  -93.59%  (p=0.000 n=10+10)

@ghemawat ghemawat requested a review from aalexand July 16, 2024 14:37
@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 67.02%. Comparing base (0ed6a68) to head (a99a299).
Report is 30 commits behind head on main.

Files Patch % Lines
internal/report/report.go 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #881      +/-   ##
==========================================
+ Coverage   66.86%   67.02%   +0.16%     
==========================================
  Files          44       44              
  Lines        9824     9796      -28     
==========================================
- Hits         6569     6566       -3     
+ Misses       2794     2778      -16     
+ Partials      461      452       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Previously, we used to call report.TextItems() during flame
graph generation just so we could get a hand on the legend
to print in the profile details box. All the work done by
TextItems() to produce a trimmed graph was discarded.

This change separates out the legend generation into a
separate routine so that we can avoid doing the unnecessary
work.

Benchmark result:

```
name      old time/op  new time/op  delta
Flame-12   6.10s ± 3%   0.39s ± 4%  -93.59%  (p=0.000 n=10+10)
```
@ghemawat ghemawat removed the request for review from macieksmuga July 22, 2024 15:21
@ghemawat ghemawat merged commit 304e4f0 into google:main Jul 22, 2024
31 checks passed
@ghemawat ghemawat deleted the flamespeed branch July 22, 2024 15:43
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