Only compute submittable during submitted_together

The submittable field of ChangeInfo is undocumented and only used
by the Submitted Together tab of the web UI. It's also quite costly
to compute as the logic currently runs the Prolog rules in the
default "accurate" mode, ignoring the setFastEvalLabels(true) mode
used by DETAILED_LABELS.

Computing submittable for every search result is one of the reasons
dashboards are slow on gerrit-review. Each change is run through the
full set of rules, which requires group membership checks for every
single reviewer vote. These membership lookups take long enough that
the sequential evaluation adds up to a noticable delay.

Just disable the field, except during the submitted_together API.

Change-Id: Iffb893f31c5c01306ace4fb13a43f5f91dd9a2da
This commit is contained in:
Shawn Pearce
2016-09-17 22:45:33 -07:00
committed by David Pursehouse
parent 44eefb5e79
commit 4cd05b2c5e
4 changed files with 14 additions and 5 deletions

View File

@@ -126,6 +126,7 @@ public class SubmittedTogether implements RestReadView<ChangeResource> {
info.changes = json.create(EnumSet.of(
ListChangesOption.CURRENT_REVISION,
ListChangesOption.CURRENT_COMMIT))
.includeSubmittable(true)
.formatChangeDatas(cds);
info.nonVisibleChanges = hidden;
return info;