view contrib/xml.rnc @ 26117:4dc5b51f38fe

revlog: change generaldelta delta parent heuristic The old generaldelta heuristic was "if p1 (or p2) was closer than the last full text, use it, otherwise use prev". This was problematic when a repo contained multiple branches that were very different. If commits to branch A were pushed, and the last full text was branch B, it would generate a fulltext. Then if branch B was pushed, it would generate another fulltext. The problem is that the last fulltext (and delta'ing against `prev` in general) has no correlation with the contents of the incoming revision, and therefore will always have degenerate cases. According to the blame, that algorithm was chosen to minimize the chain length. Since there is already code that protects against that (the delta-vs-fulltext code), and since it has been improved since the original generaldelta algorithm went in (2011), I believe the chain length criteria will still be preserved. The new algorithm always diffs against p1 (or p2 if it's closer), unless the resulting delta will fail the delta-vs-fulltext check, in which case we delta against prev. Some before and after stats on manifest.d size. internal large repo old heuristic - 2.0 GB new heuristic - 1.2 GB mozilla-central old heuristic - 242 MB new heuristic - 261 MB The regression in mozilla central is due to the new heuristic choosing p2r as the delta when it's closer to the tip. Switching the algorithm to always prefer p1r brings the size back down (242 MB). This is result of the way in which mozilla does merges and pushes, and the result could easily swing the other direction in other repos (depending on if they merge X into Y or Y into X), but will never be as degenerate as before. I future patch will address the regression by introducing an optional, even more aggressive delta heuristic which will knock the mozilla manifest size down dramatically.
author Durham Goode <durham@fb.com>
date Sun, 30 Aug 2015 13:58:11 -0700
parents 3acfb69a4729
children
line wrap: on
line source

# RelaxNG schema for "xml" log style
# Inspired by Subversion's XML log format.

start = log
node.type = xsd:string  {minLength = "40" maxLength = "40"}

log = element log { logentry+ }
logentry = element logentry {
    logentry.attlist,
    branch*, tag*, hgparent*,
    author, date,
    msg, paths?, copies?, extra*
}
logentry.attlist =
    attribute revision {xsd:nonNegativeInteger}
  & attribute node {node.type}
branch = element branch { text }
tag = element tag { text }
hgparent = element parent {hgparent.attlist, text}
hgparent.attlist =
    attribute revision {xsd:integer {minInclusive = "-1"} }
  & attribute node {node.type}
author = element author { author.attlist, text }
author.attlist =
    attribute email {text}
date = element date {xsd:dateTime}
msg = element msg {msg.attlist, text}
msg.attlist =
    attribute xml:space {"preserve"}
paths = element paths { path* }
path = element path { path.attlist, text }
path.attlist =
    # Action: (A)dd, (M)odify, (R)emove
    attribute action {"A"|"M"|"R"}
copies = element copies { copy+ }
copy = element copy { copy.attlist, text }
copy.attlist =
    attribute source {text}
extra = element extra {extra.attlist, text}
extra.attlist =
    attribute key {text}