Skip to content
Snippets Groups Projects
Commit cdda5fab authored by Georges Racinet's avatar Georges Racinet
Browse files

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.
parent f107ab58
No related branches found
No related tags found
Loading
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment