@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.

Remove expensive, pointless typeachecking in custom fields

Summary:
Ref T11404. On my system, this improves performance by 10-15% for `differential.revision.search`.

`PhutilTypeSpec` provides high quality typechecking and is great for user-facing things that need good error messages.

However, it's also a bit slow, and pointless here (the API is internal and it only has one possible option).

I think I added this after writing `checkMap` just because I wanted to use it more often. My desire is sated after finding many reasonable ways to use it to give users high-quality error messages about things like configuration files.

Test Plan: Profiled `differential.revision.search` before and after change, saw wall time drop from ~220ms to ~195ms.

Reviewers: yelirekim, chad

Reviewed By: chad

Maniphest Tasks: T11404

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

-6
-6
src/infrastructure/customfield/field/PhabricatorCustomField.php
··· 112 112 $object, 113 113 array $options = array()) { 114 114 115 - PhutilTypeSpec::checkMap( 116 - $options, 117 - array( 118 - 'withDisabled' => 'optional bool', 119 - )); 120 - 121 115 $field_objects = id(new PhutilSymbolLoader()) 122 116 ->setAncestorClass($base_class) 123 117 ->loadObjects();