sparse-revlog: fast-path before computing payload size
In this fast-path case, we do not need to compute the full delta chain
payload. Since it comes with a significant cost, we avoid doing so if
possible.
--- a/mercurial/revlogutils/deltas.py Tue Oct 16 14:46:28 2018 +0200
+++ b/mercurial/revlogutils/deltas.py Thu Nov 08 15:29:58 2018 +0100
@@ -257,13 +257,13 @@
return
deltachainspan = segmentspan(revlog, revs)
- chainpayload = sum(length(r) for r in revs)
if deltachainspan < mingapsize:
yield revs
return
readdata = deltachainspan
+ chainpayload = sum(length(r) for r in revs)
if deltachainspan:
density = chainpayload / float(deltachainspan)