I’m having a big closure that takes too much to evaluate. And it has no IFDs. That’s weird.
I’m used to using py-spy to generate flamegraph data that I can feed into https://www.speedscope.app/ to inspect and solve Python apps performance bottlenecks.
I’m trying your solution and a problem I find is that my .folded file occupies about 59 GB, so I cannot upload it to speedscope, and trying to get a local flamegraph out of it blows my machine.
Is there any other more efficient way to get a flamegraph?
py-spy has the notion of samples per second. I think that’s how they produce a reasonably-sized dump.
It seems to me that nix just traces every single call, which can amount to many millions when using modules (I have them while using flake-parts and dream2nix in the same project).
It would be nice to be able to have a “samples per second” option for --trace-function-calls.
Nix is putting control chars in stderr for some reason. After cleaning up the control characters and passing it through this very jank AI-generated script, flamegraph.pl is able to generate svgs.
EDIT: Nevermind, the script doesn’t produce correct results. But it should be easy enough to do.