baverman / flameprof

Flamegraph generator for cProfile stats
MIT License
237 stars 15 forks source link

Compute block_counts iteratively with explicit stack #13

Open maffoo opened 1 year ago

maffoo commented 1 year ago

I get recursion errors when converting some large profiles with flameprof. This change avoids these RecursionErrors by using iteration with an explicit stack to compute block counts. Could get a similar effect using sys.setrecursionlimit with the existing recursive implementation, but there's no way to choose a sufficiently large limit, so a non-recursive implementation seems safer.

maffoo commented 3 weeks ago

Hi @baverman, I wanted to ask whether there's any chance to get this merged? I'd love to be able to continue using flameprof without having to patch it locally to increase the stack size.