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

Fix slow pprof for Alloc profiles: Use integer keys; stop stringifying StackFrames (it's expensive) #86

Merged
merged 9 commits into from
Jul 27, 2023

Conversation

NHDaly
Copy link
Member

@NHDaly NHDaly commented Jul 8, 2023

In #70, we fixed the issue in #69 (multiple stackframes hashing to the same thing) by stringifying the stack frame. This turns out to be terribly, terribly slow.

This PR instead fixes the issue by manually constructing a unique Location for each frame in the stack, by pairing the unique function ID with the line number of the frame. This is what is meant by a location: a function + a line number, so that should be a perfectly suitable unique location key.

I also added a rigorous regression-testing file, which compares the profiles produced by any branch to the profiles produced on main. This helped me be confident in this change, and should help us prevent any issues in the future.

@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@af9eba3). Click here to learn what that means.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main      #86   +/-   ##
=======================================
  Coverage        ?   96.59%           
=======================================
  Files           ?        3           
  Lines           ?      294           
  Branches        ?        0           
=======================================
  Hits            ?      284           
  Misses          ?       10           
  Partials        ?        0           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@NHDaly NHDaly force-pushed the nhd-allocs-perf branch 2 times, most recently from 46ef06a to d87d0f2 Compare July 8, 2023 16:50
Copy link
Collaborator

@vilterp vilterp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit, thanks!

@NHDaly NHDaly merged commit 60b23c7 into main Jul 27, 2023
9 checks passed
@NHDaly NHDaly deleted the nhd-allocs-perf branch July 27, 2023 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants