Page MenuHomePhorge

Remove unused code in ManiphestReportController::renderBurn()
Needs ReviewPublic

Authored by aklapper on Tue, Mar 4, 11:03.
Tags
None
Referenced Files
F3221510: D25902.1741858739.diff
Wed, Mar 12, 09:38
F3221487: D25902.1741854379.diff
Wed, Mar 12, 08:26
F3216877: D25902.1741719006.diff
Mon, Mar 10, 18:50
F3215958: D25902.1741672375.diff
Mon, Mar 10, 05:52
F3215887: D25902.1741668513.diff
Mon, Mar 10, 04:48
F3215774: D25902.1741661408.diff
Mon, Mar 10, 02:50
F3207648: D25902.1741432783.diff
Fri, Mar 7, 11:19
F3207647: D25902.1741432781.diff
Fri, Mar 7, 11:19

Details

Summary

ManiphestReportController (which renders /maniphest/report/burn/) wastes CPU cycles. Thus remove useless code.

It tries to construct table rows never to be shown: The code calculates rows and adds them via $table = new AphrontTableView($rows), then defines $panel = new PHUIObjectBoxView() and does $panel->setTable($table) but a bit later $panel = id(new PhabricatorProjectBurndownChartEngine()) overwrites that table and all its data.
This re-definition of $panel was introduced in rP5c1b91ab457db9f3db10d8cc5e07831512645ebb.

The code creates a PhabricatorProjectBurndownChartEngine anyway, similar to PhabricatorProjectReportsController. So none of those expensive database queries are needed at all. Variables like list($burn_x, $burn_y) = $this->buildSeries($data); are never read since rPf8ebc71b8f217ed156f416ddb4cd028dcaa28174.

Bug: T16005

Test Plan
  1. Make sure /applications/view/PhabricatorFactApplication/ is installed
  2. Go to /maniphest/report/burn/ for global view, go to some URL like /maniphest/report/burn/?project=PHID-PROJ-1234567890abcdef for per-projcet view
  3. See that the "Burnup Rate" chart is rendered in the same way before and after applying this patch
  4. Optionally, run ./bin/cache purge --all (but looks like no charts are cached?) and reload
  5. Optionally, go to /project/reports/1/ and as expected the burndown chart is the same as in step 2

Diff Detail

Repository
rP Phorge
Branch
T16005ChartPerform (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1766
Build 1766: arc lint + arc unit

Event Timeline

aklapper requested review of this revision.Tue, Mar 4, 11:03
aklapper retitled this revision from Remove unused code in ManiphestReportController:renderBurn() to Remove unused code in ManiphestReportController::renderBurn().Tue, Mar 4, 11:06

It seems that there is even more code to rip out here

Rip out more unused ancient code like unneeded expensive database queries

aklapper edited the test plan for this revision. (Show Details)