Skip to content
Snippets Groups Projects
Commit fbf3cf982d30 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

phases: rework the logic of _pushdiscoveryphase to bound complexity

This rework the various graph traversal in _pushdiscoveryphase to keep the
complexity in check.

This is done though a couple of things:

- first, limiting the space we have to explore, for example, if we are not in
  publishing push, we don't need to consider remote draft roots that are also
  draft locally, as there is nothing to be moved there.

- avoid unbounded descendant computation, and use the faster "rev between"
  computation.

This provide a massive boost to performance when exchanging with repository with
a massive amount of draft, like mozilla-try:

### data-env-vars.name                             = mozilla-try-2023-03-22-zstd-sparse-revlog
  # benchmark.name                                 = hg.command.push
  # bin-env-vars.hg.flavor                         = default
  # bin-env-vars.hg.py-re2-module                  = default
  # benchmark.variants.explicit-rev                = all-out-heads
  # benchmark.variants.issue6528                   = disabled
  # benchmark.variants.protocol                    = ssh
  # benchmark.variants.reuse-external-delta-parent = default

 ## benchmark.variants.revs                        = any-1-extra-rev
before: 19.617617
after:  12.134353  (-38.15%, -7.48)
 ## benchmark.variants.revs                        = any-100-extra-rev
before: 24.045368
after:  17.054653  (-29.07%, -6.99)


After this changes, the push operation is still quite too slow. Some of this
can be attributed to general phases slowness (reading all the roots from disk
for example) and other know slowness (not using persistent-nodemap, branchmap,
tags, etc. We are also working on them, but with this series, phase discovery
during push no longer showing up in profile and this is a pretty nice and bit
low-hanging fruit out of the way.

### (same case as the above)
  # benchmark.variants.revs                        = any-1-extra-rev
pre-%ln-change: 44.235070
this-changeset: 12.134353 (-72.57%, -32.10)
  # benchmark.variants.revs                        = any-100-extra-rev
pre-%ln-change: 49.234697
this-changeset: 17.054653 (-65.36%, -32.18)
parent 773852b7ff0c
No related branches found
No related tags found
Loading
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