1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 02:12:41 +01:00
phorge-phorge/src
epriestley 27ce691839 Fix an issue with the Herald engine field value cache
Summary:
To improve the performance of Herald, we attempt to generate the value for each field (e.g., a task title) only once.

For most field values this is cheap, but for some (like a commit's branches) it can be quite expensive. We only want to pay this cost once, so we cache field values.

However, D12957 accidentally added a check where we bypass the cache and generate the value for every field, before reading the cache. This causes us to generate each field for every rule that uses it, plus one extra time.

Instead, use the cache for this check, too. Also allow the cache to cache `null`, since it can be expensive to generate `null` even though the value isn't too interesting.

The value of this early hit isn't even used (we only care if it throws or not).

Test Plan:
  - Wrote a rule like "if any condition matches: branches contain a, branches contain b, branches contain c".
  - Put `phlog(new Exception())` in `DiffusionCommitBranchesHeraldField`.
  - Before patch, saw `bin/repository reparse --herald <any commit>` compute branches three times.
  - After patch, saw only one computation.
  - Verified field values in the transcript view

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D15451
2016-03-09 10:28:50 -08:00
..
__tests__ Use PhutilClassMapQuery instead of PhutilSymbolLoader 2015-08-14 07:49:01 +10:00
aphront Use large text columns to store IP addresses 2016-02-02 10:13:14 -08:00
applications Fix an issue with the Herald engine field value cache 2016-03-09 10:28:50 -08:00
docs Fix a typo on Almanac User Guide 2016-03-06 15:49:44 -08:00
extensions Add src/extensions/ to Phabricator 2013-08-14 15:38:06 -07:00
infrastructure Provide bin/nuance import and ngram indexes for sources 2016-03-08 10:30:24 -08:00
view Polish up timeline for PHIUTwoColumnView 2016-03-08 17:51:53 -08:00
__phutil_library_init__.php Delete license headers from files 2012-11-05 11:16:51 -08:00
__phutil_library_map__.php Begin adding test coverage to GitHub Events API parsers 2016-03-09 09:30:07 -08:00