revlog: document high frequency of code execution
authorGregory Szorc <gregory.szorc@gmail.com>
Wed, 24 Aug 2016 20:18:58 -0700
changeset 30012 60a66c79125f
parent 30011 d81fe5af92b8
child 30013 1659549870e1
revlog: document high frequency of code execution Recording my notes while working on performance optimization.
mercurial/revlog.py
--- a/mercurial/revlog.py	Wed Aug 24 20:00:52 2016 -0700
+++ b/mercurial/revlog.py	Wed Aug 24 20:18:58 2016 -0700
@@ -1471,6 +1471,10 @@
         # should we try to build a delta?
         if prev != nullrev:
             tested = set()
+            # This condition is true most of the time when processing
+            # changegroup data into a generaldelta repo. The only time it
+            # isn't true is if this is the first revision in a delta chain
+            # or if ``format.generaldelta=true`` disabled ``lazydeltabase``.
             if cachedelta and self._generaldelta and self._lazydeltabase:
                 # Assume what we received from the server is a good choice
                 # build delta will reuse the cache