@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Conpherence - use some handle pools for Durable column perf

Summary:
Ref T7708.

This changes things to $viewer->loadHandles where applicable in the durable column render stack. I saw some big wins on my test data like 34 queries => 24 queries on a newly created room as my default thread.

For my test data, the next big perf win would be to change how remarkup rendering works and try to multiload all objects of a certain type in one shot.
e.g. `PhabricatorEmbedFileRemarkupRule` implements `loadObjects` as do all classes which inherit from `PhabricatorObjectRemarkupRule`. This is because `PhabricatorObjectRemarkupRule` implements its `didMarkupText` method using `loadObjects`, and `didMarkupText` gets called per transaction over in `PhabricatorMarkupEngine->process()`. Instead, the `loadObjects` in `didMarkupText` should be hitting some cache, and we should do a bulk load for all `PhabricatorEmbedFileRemarkupRule` that had matches earlier in the rendering stack. ...I think.

Test Plan: carefully looked at "Services" tab in dark console and noted fewer queries with changes post changes versus pre changes

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7708

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

+8 -12
+3 -4
src/applications/conpherence/query/ConpherenceThreadQuery.php
··· 285 285 $conpherence->$method(); 286 286 } 287 287 $flat_phids = array_mergev($handle_phids); 288 - $handles = id(new PhabricatorHandleQuery()) 289 - ->setViewer($this->getViewer()) 290 - ->withPHIDs($flat_phids) 291 - ->execute(); 288 + $viewer = $this->getViewer(); 289 + $handles = $viewer->loadHandles($flat_phids); 290 + $handles = iterator_to_array($handles); 292 291 foreach ($handle_phids as $conpherence_phid => $phids) { 293 292 $conpherence = $conpherences[$conpherence_phid]; 294 293 $conpherence->attachHandles(
+2 -4
src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php
··· 126 126 $handles = array(); 127 127 $merged = array_mergev($phids); 128 128 if ($merged) { 129 - $handles = id(new PhabricatorHandleQuery()) 130 - ->setViewer($this->getViewer()) 131 - ->withPHIDs($merged) 132 - ->execute(); 129 + $handles = $this->getViewer()->loadHandles($merged); 130 + $handles = iterator_to_array($handles); 133 131 } 134 132 foreach ($xactions as $xaction) { 135 133 $xaction->setHandles(
+3 -4
src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
··· 28 28 protected function loadHandles(array $objects) { 29 29 $phids = mpull($objects, 'getPHID'); 30 30 31 - $handles = id(new PhabricatorHandleQuery($phids)) 32 - ->withPHIDs($phids) 33 - ->setViewer($this->getEngine()->getConfig('viewer')) 34 - ->execute(); 31 + $viewer = $this->getEngine()->getConfig('viewer'); 32 + $handles = $viewer->loadHandles($phids); 33 + $handles = iterator_to_array($handles); 35 34 36 35 $result = array(); 37 36 foreach ($objects as $id => $object) {