-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/adt: disable prep for associative lists
This preparation is currently causing significant performance issues. As it is not used, we disable it for now. The issue follows from the following: 1) the list type can (currently) only be known after the last conjunct is processed. 2) lists are not processed until the list type is known 3) this means that lists are not processed and added to the disjunct for any but the last disjunction 4) this means that disjuncts with the same list cannot be compared and are not prematurely eliminated. There are many possible ways to fix this. For instance, 1) we could first evaluate disjuncts, before taking their cross product, to determine what the list type will be. 2) as we only care about equality, we could anyway evaluate lists, and compare lists collected so far based on equality. This can especially be fast when we have a fast equality check. For now we just disable the state. This change exposes another issue: basically, if evaluated in the right order, a closedContext.Expr may be non-nil if a struct is not closed. The resulting panic is just to catch an optimization. This will be easier to fix once we support the same semantics for lists as we have for structs. So for now, we just disable the check. Note that this causes some error messages to now mention a "cycle error", which is indicative of displaying an unevaluated value. We will worry about that later. It is not material for the result. Issue #2850 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I11df185bb5d3747e72c3ca2888ee4dd7cce70d47 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1204490 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Matthew Sackman <[email protected]>
- Loading branch information
Showing
10 changed files
with
144 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.