Gregory Szorc <gregory.szorc@gmail.com> [Sun, 25 Jun 2017 12:41:34 -0700] rev 33171
revlog: C implementation of delta chain resolution
I've seen revlog._deltachain() appear in a number of performance
profiles. I suspect there are 2 reasons for this:
1. Delta chain resolution performs many index lookups, thus triggering
population of index tuples. Creating possibly tens of thousands of
PyObject will have overhead.
2. Delta chain resolution is a tight loop.
By moving delta chain resolution to C, we can defer instantiation
of full index entry tuples and make the loop faster courtesy of
not running in Python.
We can measure the impact to delta chain resolution via
`hg perflogrevision` using the mozilla-central repo with a recent
manifest having delta chain length of 33726:
$ hg perfrevlogrevision -m 364895
! full
! wall 0.367585 comb 0.370000 user 0.340000 sys 0.030000 (best of 27)
! wall 0.357581 comb 0.360000 user 0.350000 sys 0.010000 (best of 28)
! deltachain
! wall 0.010644 comb 0.010000 user 0.010000 sys 0.000000 (best of 270)
! wall 0.000292 comb 0.000000 user 0.000000 sys 0.000000 (best of 8729)
$ hg perfrevlogrevision --cache -m 364895
! deltachain
! wall 0.003904 comb 0.000000 user 0.000000 sys 0.000000 (best of 712)
! wall 0.000284 comb 0.000000 user 0.000000 sys 0.000000 (best of 9926)
The first test measures savings from both not instantiating index
entries and moving to C. The second test (which doesn't clear the
index caches) essentially isolates the benefits of moving from Python
to C. It still shows a 13.7x speedup (versus 36.4x). And there are
multiple milliseconds of savings within the critical path for resolving
revision data. I think that justifies the existence of C code.
A more striking example of the benefits of this change can be
demonstrated by timing `hg debugdeltachain -m` for the mozilla-central
repo:
$ time hg debugdeltachain -m > /dev/null
before: 1057.4s
after: 503.3s
PyPy2.7 5.8.0: 220.0s
It's worth noting that the C code isn't as optimal as it could be.
We're still instantiating a new PyObject for every revision. A future
optimization would be to reuse the PyObject on the cached index tuple.
We could potentially also get wins by using a memory array of raw
integers. There is also room for a delta chain cache on revlog
instances. Of course, the best optimization is to implement revlog
reading outside of Python so Python doesn't need to be concerned
about the relatively expensive index entries and operations on them.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 04 Jul 2017 22:58:21 -0400] rev 33170
help: cleanup grammar in the hooks section
Augie Fackler <augie@google.com> [Tue, 04 Jul 2017 10:18:44 -0400] rev 33169
merge with i18n
Augie Fackler <augie@google.com> [Tue, 04 Jul 2017 10:17:14 -0400] rev 33168
revlog: backed out changeset
e9d325cfe071
We'll move this to the default branch.
Wagner Bruna <wbruna@softwareexpress.com.br> [Thu, 29 Jun 2017 12:07:54 -0300] rev 33167
i18n-pt_BR: synchronized with
efebc9f52ecb
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:32:36 +0200] rev 33166
config: register the 'devel.strip-obsmarkers' config
The single explicit default that existed so far is converted to registered
config value.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:32:28 +0200] rev 33165
config: register the 'devel.serverrequirecert' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:32:18 +0200] rev 33164
config: register the 'devel.serverexactprotocol' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:32:07 +0200] rev 33163
config: register the 'devel.servercafile' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:31:18 +0200] rev 33162
config: register the 'devel.disableloaddefaultcerts' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:31:05 +0200] rev 33161
config: register the 'devel.check-relroot' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:37:59 +0200] rev 33160
config: register the devel.check-locks config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:25:33 +0200] rev 33159
config: register the 'devel.bundle2.debug' config
Existing explicit default are dropped now that the default is centralised.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:19:40 +0200] rev 33158
config: register the 'devel.all-warnings' config
Let us start registering the existing option. I'm starting with the 'devel'
section because it is full of useful things that are poorly documented. So
registering these will more than other section.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 28 Jun 2017 14:53:54 -0700] rev 33157
rebase: always pass destination as revnum to _handleskippingobsolete()
We were passing it as a revision number in one place and as a context
in another. It worked because the only use was in "repo[dest].rev()",
but it was confusing. By always passing a revision number, we can also
remove that unnecessary lookup.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 29 Jun 2017 23:04:47 -0700] rev 33156
patch: remove unused fsbackend._join()
The function lost its last caller in
2a095d3442e0 (patch: replace
functions in fsbackend to use vfs, 2014-06-05) when the callers
started relying on the opener to do the join.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 30 Jun 2017 09:07:24 -0700] rev 33155
patch: add close() to abstractbackend
patchbackend() seems to call it on an arbitrary backend, so it seems
to be part of the API. Since all subclasses do something in their
close() methods, I decided to let this one raise an exception rather
than just pass.
Boris Feld <boris.feld@octobus.net> [Mon, 26 Jun 2017 15:46:24 +0200] rev 33154
log: add an extension hook-point in changeset_printer
Extensions sometimes wants to add other information in the default log output
format (when no templating is used).
Add an empty function named '_exthook' for easing the extension life.
Extensions will be able to wrap this function and collaborate to display
additional information.
Exthook is called after displaying troubles and just before displaying the
files, extra and description.
Add a new test file to test it and not pollute other test files.
Jun Wu <quark@fb.com> [Tue, 27 Jun 2017 00:01:17 -0700] rev 33153
drawdag: support obsmarker creation in comments
This patch adds special comment handling so one can create obsmarkers in
drawdag comments like "# replace: A -> B -> C", "# prune: X, Y, Z",
"split: P -> M, N" and they are just self-explained.
Jun Wu <quark@fb.com> [Mon, 26 Jun 2017 23:31:53 -0700] rev 33152
test-drawdag: add a test for drawdag.py
The drawdag script is useful but does not have a formal test. This patch
adds it.
Phil Cohen <phillco@fb.com> [Mon, 26 Jun 2017 22:52:15 -0700] rev 33151
filemerge: convert a couple of wvfs calls in internal mergetools to contexts
One hitch is that sometimes fcd is actually an absentfilectx which does not
expose any mutator functions. In order to still use the context functions,
we look up the underlying workingfilectx to perform the write there.
One alternate way would be to put the write functions on the absentfilectx and
have them pass-through. While this makes the callsites cleaner, we would need
to decide what its getter functions would return after this point, since
returning None for `data` (and True for `isabsent()`) might no longer be
correct after a write. I discussed with Sidd about just having the getters
raise RuntimeErrors after a mutator has been called, but we actually call
isabsent() in merge.py after running the internal merge tools.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:50:20 +0200] rev 33150
configitems: support callable as a default value
Yuya pointed out that using mutable value as the default could be problematic.
To work around this we now support callable object as default value. This
allows for creating new mutable objects on demand when needed.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 02:06:15 +0200] rev 33149
obsutil: move 'getmarkers' to the new modules
We have a new 'obsutil' module now. We move the high level utility there to
bring 'obsolete.py' back to a more reasonable size.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:51:40 +0200] rev 33148
obsutil: move the 'marker' class to the new modules
We have a new 'obsutil' module now. We move high level utility there to bring
'obsolete.py' back to a more reasonable size.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:48:41 +0200] rev 33147
obsolete: delete three unused utility functions
None of this function has been used in the past 5 years, so I think it is safe
to just kill them. All code accessing rich markers is using 'getmarkers(...)'
instead (or raw markers).
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:40:34 +0200] rev 33146
obsutil: move 'foreground' to the new modules
We have a new 'obsutil' module now. We move the high level utility there to
bring 'obsolete.py' back to a more reasonable size.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:36:20 +0200] rev 33145
obsutil: move 'allsuccessors' to the new modules
We have a new 'obsutil' module now. We move the high level utility there to bring
'obsolete.py' back to a more reasonable size.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:31:18 +0200] rev 33144
obsutil: move 'allprecursors' to the new modules
We have a new 'obsutil' module now. We move the high level utility there to
bring 'obsolete.py' back to a more reasonable size.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:11:56 +0200] rev 33143
obsutil: move 'exclusivemarkers' to the new modules
We have a new 'obsutil' module now. We move the high level utility there to
bring 'obsolete.py' back to a more reasonable size.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:03:01 +0200] rev 33142
obsutil: move 'successorssets' to the new modules
We have a new 'obsutil' module now. We move this high level utility there to bring
'obsolete.py' back to a more reasonable size.