Page MenuHomePhabricator

Only parse constraint parameters once per constraint
Open, MediumPublic

Description

As a more general version of T180799: Only parse constraint exceptions once per constraint, I suppose there’s no reason to parse any other constraint parameters more than once, either. CachingConstraintLookup (from T89349: [Task] Only query constraints table once per property) should already ensure that all constraint checks for the same constraint operate on the same Constraint object, so we could use that to cache the constraint parameters.

Currently, we store a slightly transformed version of the constraint parameters on the check result. (Usually, the transformation only consists of wrapping a single-valued parameter, like “relation” or “namespace”, in a one-element array, but the type checkers also convert their array of class entity ID serializations to entity ID objects.)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 17 2017, 4:02 PM