[PATCH 0 of 4] *.cmp methods under close scrutiny

Nicolas Dumazet nicdumz at gmail.com
Fri Jul 9 03:14:45 UTC 2010


Hello!

This journey started when tracking down
  http://mercurial.selenic.com/bts/issue2273
and understanding the cost of a filelog.cmp call.

* Patch 1 & 2 revolve around the fact that all our cmp() methods (revlog,
  filelog, filectx) return True if second operand is different than self.

  workingfilectx.cmp however, wants to sound original and does the *contrary*.
  Any specific reason for this? I couldnt find any documentation and assumed
  that it was a bug.
  It seems that current code doesnt use workingfilectx.cmp but the somehow
  symmetric filectx.cmp(workingfilectx.read()), hence the silent failure.

* 3: test what is happening in filelog with data starting with \1\n. size()
  calls return wrong results, but it seems that there is no cheap way to avoid
  this with the current architecture.

* 4: finally improve perfs in filelog.cmp


Imho, this serie belongs to stable; but you might disagree.


Thanks for your reviews!

-Nicolas.


More information about the Mercurial-devel mailing list