]> khamidou — GitHub mirrors - arcanist.git/commit
Improve hg arc diff perf when image files are uploaded
authordurham <durham@fb.com>
Thu, 28 Feb 2013 17:46:42 +0000 (09:46 -0800)
committerdurham <durham@fb.com>
Thu, 28 Feb 2013 17:46:42 +0000 (09:46 -0800)
commit8412f7cfd78188febfd1a85fbebf2d9395570ccf
tree2b235597735ec38d08c75dd0b18ecc4e715655d4
parent0cb1b7efad98d207f3121cc2928df82ed6ff0d88
Improve hg arc diff perf when image files are uploaded

Summary:
arc diff called 'hg cat' twice for every image binary in the diff.
This turns out to take 1 second per call on a large repo because mercurial
has to parse the manifest every time.

Now arc diff batches up all the files and does only two 'hg cat'
commands.  This makes the cost constant relative to the number of
images being uploaded.

Test Plan:
Ran arc diff on a diff with 30 images on both git and hg.
Verified that it was fast and that the images showed up in the web ui.

Reviewers: epriestley

Reviewed By: epriestley

CC: sid0, dschleimer, bos, aran, Korvin
Differential Revision: https://secure.phabricator.com/D5144
src/parser/ArcanistDiffParser.php
src/repository/api/ArcanistMercurialAPI.php
src/repository/api/ArcanistRepositoryAPI.php