Add support for the Allocs profiles produced by Julia's Allocs Profiler#46
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
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) |
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 <nhdaly@gmail.com>
|
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
| 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.
😮 what is this -> syntax??
There was a problem hiding this comment.
Lambda/Closure/Anonymous Function
There was a problem hiding this comment.
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 <nhdaly@gmail.com>
## 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 <nhdaly@gmail.com>
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.