JuliaPerf / PProf.jl

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

For PProf.Allocs, change the default metric to `allocs`, not `size`. #55

Closed NHDaly closed 2 years ago

NHDaly commented 2 years ago

We default to allocs, since julia's Profile.Allocs code currently uniformly samples accross allocations, so allocs is a representative profile, while size is not.

Explanation:

If each allocation was uniform (as in the case of the allocs sample type), then uniformly sampling should give an accurate distribution of where the allocations occur: code that allocates more often is more likely to show up in the profile.

But if the metric we're interested in is not uniform: how many bytes are allocated, uniform sampling will not get us a representative distribution of where the bytes are allocated! Code that allocates very large objects is no more or less likely to be included than code that allocates very small ones.

codecov-commenter commented 2 years ago

Codecov Report

Merging #55 (003440b) into master (18d842d) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #55   +/-   ##
=======================================
  Coverage   72.81%   72.81%           
=======================================
  Files           3        3           
  Lines         298      298           
=======================================
  Hits          217      217           
  Misses         81       81           
Impacted Files Coverage Δ
src/Allocs.jl 0.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 18d842d...003440b. Read the comment docs.