HomePhabricator

Improve performance of "arc diff" updates for changes with large diff text

Description

Improve performance of "arc diff" updates for changes with large diff text

Summary:
See PHI1104. The older "differential.querydiffs" method includes the entire raw diff text for all the diffs associated with a revision in its response, but we: only care about the most recent diff; and don't care about the text at all.

For reasonably large changes with several updates, this can be significantly slow.

We can get this same information more efficiently from the modern "differential.diff.search", since D19386 (April 2018). The only trick is that we need a "revisionPHID", which we don't have on hand.

For now, just fetch the revision PHID. In the future, we can likely make adjustments so that we have the revision PHID already by the time we get here.

This may slow down the normal case very slightly (since we now do two calls instead of one), but it speeds up the bad cases dramatically.

Test Plan:
Ran arc diff to update a change in a local repository. var_dump()'d the old and new algorithm results, saw the same outcome.

Used arc diff --trace on an update to a change to verify that differential.diff.search is called but differential.querydiffs is not.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D20221

Details

Provenance
epriestleyAuthored on Feb 27 2019, 9:43 AM
epriestleyPushed on Feb 28 2019, 4:00 PM
Reviewer
amckinley
Differential Revision
D20221: Improve performance of "arc diff" updates for changes with large diff text
Parents
rARC9581dd0f5272: Add Arcanist support for highlighting indent change intraline diffs
Branches
Unknown
Tags
Unknown
Build Status
Buildable 22144
Build 30257: Run Core Tests