manifest: convert a recursive function to iterative one using stacks

Authored by pulkit.

Description

manifest: convert a recursive function to iterative one using stacks

I am debugging a memory issue from yesterday where hg update goes upto taking
22GB of memory on our internal treemanifest repository. This is an interesting
function and I saw memory consumption increasing while this function was
running.

It's sometimes hard to understand a recursive function and also the profile
won't show you actual operations which took time, rather it will show you the
function again and again in profile.

I am yet to notice any memory consumption decrease with this patch, but I
believe this will help like in making this a generator.

Differential Revision: https://phab.mercurial-scm.org/D5413

Details

Committed
pulkitDec 12 2018, 8:26 AM
Differential Revision
D5413: manifest: convert a recursive function to iterative one using stacks
Parents
rHG191fac9ff9d3: obsutil: fix the issue5686
Branches
Unknown
Tags
Unknown