Skip to content

Commit

Permalink
internal/core/adt: clone arcMap
Browse files Browse the repository at this point in the history
This has some performance benefits as
exposed by the stats in tests that were
added since.

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Ie661494bfde8d4f118c0ac3e0a2f9b247f9accbc
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/551407
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
Reviewed-by: Aram Hăvărneanu <aram@cue.works>
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
  • Loading branch information
mpvl committed Mar 24, 2023
1 parent 6843415 commit dbf7bb8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cue/testdata/benchmarks/issue1684.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Allocs: 49
Retain: 0

Unifications: 740771
Conjuncts: 3143640
Conjuncts: 2327328
Disjuncts: 995025
-- out/eval --
(struct){
Expand Down
10 changes: 5 additions & 5 deletions cue/testdata/cycle/issue990.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ out: #sub & {#p: _test.s1}
}
-- out/eval/stats --
Leaks: 6
Freed: 3932
Reused: 3909
Freed: 3232
Reused: 3209
Allocs: 29
Retain: 43

Unifications: 3116
Conjuncts: 15808
Disjuncts: 3975
Unifications: 2588
Conjuncts: 12056
Disjuncts: 3275
-- out/eval --
(struct){
#AC: (#struct){
Expand Down
2 changes: 1 addition & 1 deletion cue/testdata/disjunctions/incomplete.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Allocs: 6
Retain: 0

Unifications: 40
Conjuncts: 101
Conjuncts: 99
Disjuncts: 70
-- out/eval --
(struct){
Expand Down
10 changes: 5 additions & 5 deletions cue/testdata/export/030.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ eval: true
}
-- out/eval/stats --
Leaks: 0
Freed: 82
Reused: 70
Allocs: 12
Freed: 70
Reused: 59
Allocs: 11
Retain: 1

Unifications: 28
Conjuncts: 165
Disjuncts: 83
Conjuncts: 131
Disjuncts: 71
-- out/eval --
(struct){
#Foo: (#struct){
Expand Down
2 changes: 1 addition & 1 deletion internal/core/adt/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ func (n *nodeContext) clone() *nodeContext {
d.hasNonCycle = n.hasNonCycle
d.depth = n.depth

// d.arcMap = append(d.arcMap, n.arcMap...) // XXX add?
d.arcMap = append(d.arcMap, n.arcMap...)
d.cyclicConjuncts = append(d.cyclicConjuncts, n.cyclicConjuncts...)
d.notify = append(d.notify, n.notify...)
d.checks = append(d.checks, n.checks...)
Expand Down

0 comments on commit dbf7bb8

Please sign in to comment.