CommitService.FindCommits: avoid combinatoric explosion with `follow`
Using the `follow` flag already implies iteration on ancestors, and specifying ancestors of a revision with follow makes the revset engine to iterate on ancestors of each ancestor of the revision (quadratic complexity). In practice, this is a severe depletion of resources: on a large repository such as Heptapod itself, we measured up to an increase of 200MB per second of resident memory, growing until the OOMKiller saves the system at over 20G memory footprint. This can be reproduced on a clone of https://foss.heptapod.net/heptapod/heptapod with hg log -r '::default' --follow -l 40 README.md (will probably also be mitigated in Mercurial > 6.3). Since `follow` already forces iteration on ancestors, we simply don't need to add `::` in that case. This is the main solution for #117, yet more investigation is needed about `X..Y` and `X...Y` Git revspecs to actually close it.
Loading
Please register or sign in to comment