]> khamidou — GitHub mirrors - arcanist.git/commit
Improve performance of mercurial arc diff
authordurham <durham@fb.com>
Fri, 8 Feb 2013 13:54:32 +0000 (05:54 -0800)
committerdurham <durham@fb.com>
Fri, 8 Feb 2013 13:54:32 +0000 (05:54 -0800)
commitdb053e1eb73f3749bd8cbddc6730c9da8b5eb1cb
treeb6b0a3855c1f8edb585a51d8fa625d141e091375
parent7f9c286338b81f95998a4b308b1412b42c1b7436
Improve performance of mercurial arc diff

Summary:
arc diff on large mercurial repos was taking 14 seconds just to get
to the commit message prompt.  With these optimizations it takes 4.

- "ancestor(.) - ancestor(XYZ)" is expensive because it has to build the
entire 400000+ revision history for both.  "XYZ::. - XYZ" is much cheaper
because it only looks at the revisions between XYZ and the working directory.

- "hg outgoing" has to talk to the server, which is slow.  "hg log -r draft()"
gives us the same information and is much cheaper.  We fall back to 'outgoing'
on older versions of mercurial.

Of the remaining 4 seconds, 2.5 are spent in 'hg status', which is a bit harder
improve.

Test Plan: Ran arc diff on our hg repo. Verified it ran faster and the diff was created.

Reviewers: epriestley, sid0, bos, dschleimer

Reviewed By: epriestley

CC: aran, Korvin, tido
Differential Revision: https://secure.phabricator.com/D4838
src/repository/api/ArcanistMercurialAPI.php