1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

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
This commit is contained in:
epriestley 2016-07-31 09:25:24 -07:00
parent 8fd20e82fc
commit 64886b11d8

View file

@ -112,12 +112,6 @@ abstract class PhabricatorCustomField extends Phobject {
$object, $object,
array $options = array()) { array $options = array()) {
PhutilTypeSpec::checkMap(
$options,
array(
'withDisabled' => 'optional bool',
));
$field_objects = id(new PhutilSymbolLoader()) $field_objects = id(new PhutilSymbolLoader())
->setAncestorClass($base_class) ->setAncestorClass($base_class)
->loadObjects(); ->loadObjects();