JuliaPerf / PProf.jl

Export Julia profiles to the pprof format
MIT License
154 stars 17 forks source link

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

Closed NHDaly closed 11 months ago

NHDaly commented 1 year ago

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 commented 1 year ago

Codecov Report

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

:exclamation: 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           

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