-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal/eval: another performance issue with recursive definitions #1044
Comments
I have a similar issue with the following snipped #m1: {
#f1: [...]
f2: #f1
}
#m2: {
#m1
#f1: *[] | [...]
}
#s1: #m1
#s2: #m1
#s3: #m2
#s4: #m2
#s5: #m2
x: {
#s1
#s2
#s3
#s4
#s5
} Interstingly: at least 3 of |
This looks like a really nice and minimal reproducer for #758 ! Though could it also be related to one of the other |
@philippseith thanks for raising this, and for the repro (as well as @felixhuettner for your repro). All of these are almost certainly related to #803 which will be addressed with upcoming changes to the evaluation engine to support structure sharing (#804). I will leave this open however in case it turns out to be an edge case of any sort. |
The equality used in disjunction uses StructLits identity for some elimination. However, as lists initially don't have those associated these have to be created dynamically. This change ensurse a unique StructLit is associated with each list so that lists that are trivially equal can be identified as such. This doesn't address the below issues completely (there are better solutions), but in these particular cases it does improve performance considerably. Issue #758 Issue #1044 Change-Id: I5d3080aa6503584ed26563f24b68de70b446fe1b Signed-off-by: Marcel van Lohuizen <[email protected]>
The equality used in disjunction uses StructLits identity for some elimination. However, as lists initially don't have those associated these have to be created dynamically. This change ensurse a unique StructLit is associated with each list so that lists that are trivially equal can be identified as such. This doesn't address the below issues completely (there are better solutions), but in these particular cases it does improve performance considerably. Issue #758 Issue #1044 Change-Id: I5d3080aa6503584ed26563f24b68de70b446fe1b Signed-off-by: Marcel van Lohuizen <[email protected]>
The equality used in disjunction uses StructLits identity for some elimination. However, as lists initially don't have those associated these have to be created dynamically. This change ensurse a unique StructLit is associated with each list so that lists that are trivially equal can be identified as such. This doesn't address the below issues completely (there are better solutions), but in these particular cases it does improve performance considerably. Issue #758 Issue #1044 Change-Id: I5d3080aa6503584ed26563f24b68de70b446fe1b Signed-off-by: Marcel van Lohuizen <[email protected]> Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/532656 Unity-Result: CUEcueckoo <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Marcel van Lohuizen <[email protected]>
I ran into something that I suspect is the same or related:
https://cuelang.org/play/?id=jhu3SJm2Q_k#cue@export@cue Running |
My snippet from above no longer causes issues in v0.4.3 @njhartwell yours still hangs for me though |
See my reply in #803 (comment) relating to the new evaluator :) |
Originally opened by @philippseith in cuelang/cue#1044
With cue version 0.4.0 windows/amd64, the following combination of template, list, and default value causes cue vet/eval to hang causing high cpu load:
It successfully runs either when the
A.childs.B.type
is set explicitly or#Type
is defined without List support, eg. as#Type: #BasicType | #ComplexType
.The same definition did work with cue 0.2.2
Strangely, relying on the default value for
A.type
does not cause cue to hang.The text was updated successfully, but these errors were encountered: