Add a debug option to generate a flamegraph for compiler performance #4075
Labels
[C] Internal
Tracks some internal work. I.e.: Users should not be affected.
[E] Performance
Track performance improvement (Time / Memory / CPU)
Proposed change: For a given code generation pass, we'd get the call tree annotated with the time spent in each function. For instance, if
codegen_items
callscodegen_function
, which callscodegen_statement
n
times, etc., we'd get the time we spent in each of those calls, down to the end of the call tree. I'm imagining we'd visualize it as a tree because the depth of the call stack is also important, but I'm flexible on the format; the main point is getting data on how long different parts of codegen take, not just codegen as a whole.Motivation: From some rudimentary benchmarking with
with_timer
:kani/kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs
Lines 831 to 833 in 2227614
we've determined that most of Kani's compiler runtime comes from code generation. But we need more fine-grained data to know why code generation is slow. Currently, it's unclear whether:
Having this data would help us make that determination.
The text was updated successfully, but these errors were encountered: