-
Notifications
You must be signed in to change notification settings - Fork 18
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 support for the Allocs profiles produced by Julia's Allocs Profiler #46
Conversation
Codecov Report
@@ Coverage Diff @@
## master #46 +/- ##
==========================================
- Coverage 98.22% 96.39% -1.83%
==========================================
Files 2 3 +1
Lines 225 305 +80
==========================================
+ Hits 221 294 +73
- Misses 4 11 +7
Continue to review full report at Codecov.
|
f1505c4
to
8c67750
Compare
Support for visualizing the results from the allocations profiler in draft PR: JuliaLang/julia#42768. This was basically copy/pasted from https://github.com/vilterp/AllocProfileParser.jl.
8c67750
to
a81fb68
Compare
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.
nice, thanks!
src/allocs_profile.jl
Outdated
using PProf.OrderedCollections | ||
|
||
# input: e.g. "maybe_handle_const_call! at ./compiler/ssair/inlining.jl:1243" | ||
function parse_location(loc_str::String) |
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.
not used
* make from_c work * skip Array constructor * Leave out the "skip Array constructor" part for now... Co-authored-by: Nathan Daly <[email protected]>
35bc257
to
8dc2019
Compare
## Overview Record the type and stack of every allocation (or only at a given sample interval), and return as Julia objects. Alternate approach to existing alloc profiler PR: #33467 Complementary to garbage profiler PR: #42658 (maybe there's some nice way to meld them) This may be reinventing the wheel from #33467, but I'm not sure why that one needs stuff like LLVM passes. I mimicked some stuff from it, but this was my attempt to get something up and running. Could easily be missing stuff. ## Usage: ```julia using Profile.Allocs res = Allocs.@Profile sample_rate=0.001 my_func() prof = Allocs.fetch() # do something with `prof` ``` See also: JuliaPerf/PProf.jl#46 for support for visualizing these. Co-authored-by: Nathan Daly <[email protected]>
Now that this has landed in Base we should land this |
Agreed. Just made some fixups to the API; this is ready to go now! |
alloc prof: memoize stringifying type name
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.
re-approving 😛 API looks good.
outf = PProf.Allocs.pprof(out=out, web=false) | ||
|
||
# Read the exported profile | ||
prof = open(io->readproto(io, PProf.perftools.profiles.Profile()), outf, "r") |
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.
😮 what is this ->
syntax??
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.
Lambda/Closure/Anonymous Function
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.
oh, of course 🤦♂️ just hadn't seen it without parens I guess
Cool! Thanks all - merging now |
(leaving the branch up for anyone who had pointed their PProf at it locally) |
## Overview Record the type and stack of every allocation (or only at a given sample interval), and return as Julia objects. Alternate approach to existing alloc profiler PR: JuliaLang#33467 Complementary to garbage profiler PR: JuliaLang#42658 (maybe there's some nice way to meld them) This may be reinventing the wheel from JuliaLang#33467, but I'm not sure why that one needs stuff like LLVM passes. I mimicked some stuff from it, but this was my attempt to get something up and running. Could easily be missing stuff. ## Usage: ```julia using Profile.Allocs res = Allocs.@Profile sample_rate=0.001 my_func() prof = Allocs.fetch() # do something with `prof` ``` See also: JuliaPerf/PProf.jl#46 for support for visualizing these. Co-authored-by: Nathan Daly <[email protected]>
## Overview Record the type and stack of every allocation (or only at a given sample interval), and return as Julia objects. Alternate approach to existing alloc profiler PR: JuliaLang#33467 Complementary to garbage profiler PR: JuliaLang#42658 (maybe there's some nice way to meld them) This may be reinventing the wheel from JuliaLang#33467, but I'm not sure why that one needs stuff like LLVM passes. I mimicked some stuff from it, but this was my attempt to get something up and running. Could easily be missing stuff. ## Usage: ```julia using Profile.Allocs res = Allocs.@Profile sample_rate=0.001 my_func() prof = Allocs.fetch() # do something with `prof` ``` See also: JuliaPerf/PProf.jl#46 for support for visualizing these. Co-authored-by: Nathan Daly <[email protected]>
Add support for the Allocs profiles produced by Julia's Allocs Profiler
Support for visualizing the results from the allocations profiler in
draft PR:
JuliaLang/julia#42768.
This was basically copy/pasted from
https://github.com/vilterp/AllocProfileParser.jl.