[Haskell-cafe] methods/tools for reading/presenting (time/allocation) profiling information?
Johannes Waldmann
johannes.waldmann at htwk-leipzig.de
Thu Nov 25 21:28:07 UTC 2021
Dear Cafe,
with +RTS -p -RTS, the resulting .prof file
shows (in the second part) what the expensive functions are.
(counting sections as GHC docs do -
first part gives program name and options)
Often, that's useful, but sometimes, this info does not surprise me -
some things just don't have an easy implementation.
For those, I want to find out who calls them -
to possibly replace some of these calls
with a cheaper implementation (that is only valid
because the caller knows something that the callee does not)
Is there some automation for getting this information?
I am not even sure how to formalize what I want.
Perhaps, for the first N heavy cost centers (SCCs),
a suitably ordered list of their callers (that inherit the cost)?
The data is in the third (long, detailed) part of the .prof file
but I find it hard to process (in that form). It represents
the call hiearchy by indentation (first column) and adjacency (of rows)
but this goes out the window as soon as I grep or sort the rows.
The JSON output format seems the way to go
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html#json-profile-format
.
Yeah, I should probably just aeson it and then walk the tree.
I still wanted to ask for advice first, or references
to existing work. Any pointers appreciated.
- J.
More information about the Haskell-Cafe
mailing list