]> khamidou — GitHub mirrors - arcanist.git/commit
Improve performance of `arc branch` in Git with many branches
authorepriestley <git@epriestley.com>
Sat, 16 Apr 2016 16:38:17 +0000 (09:38 -0700)
committerepriestley <git@epriestley.com>
Sat, 16 Apr 2016 23:39:32 +0000 (16:39 -0700)
commita2ab38df78a9d111459fab8d0d63e74d811edf29
treea95a6d55704b6fff41370ca0060059e1281cc9a9
parent737f5c0df976fe2b3178aac6ab7feb3d3621d99e
Improve performance of `arc branch` in Git with many branches

Summary:
This is mostly just a personal quality-of-life fix. I run this command fairly often and having it return a little faster is nice.

This replaces a `git show` for each individual branch with a big `git for-each-ref` which we were already running anyway. This is quite a bit faster.

This command also occasionally hangs or segfaults for me while executing the huge pile of subprocesses. This is unreliable to reproduce, probably some bug in some PHP extension I have, and likely hard to narrow down, and this approach is better in every way anyway.

Test Plan:
  - Ran `arc branch` in Git, observed faster output (in my `phabricator/`, about 2000ms -> 1200ms).
  - Ran `arc feature` in Mercurial.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D15735
src/repository/api/ArcanistGitAPI.php
src/workflow/ArcanistFeatureWorkflow.php