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.
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.
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.