Skip to content

Commit 8241d9c

Browse files
committed
internal/core/adt: do not repeat replaceIDs calls
getReqSets already calls replaceIDs on the current nodeContext. checkTypos doesn't need to do it again. For https://github.com/Caascad/unity-tests, which is still affected by the slowness of the closedness algorithm, this brings another nice chunk of savings: │ old │ new │ │ sec/op │ sec/op vs base │ VetCaascad 8.148 ± 2% 5.539 ± 2% -32.01% (p=0.002 n=6) │ old │ new │ │ B/op │ B/op vs base │ VetCaascad 3.640Gi ± 0% 3.316Gi ± 0% -8.92% (p=0.002 n=6) │ old │ new │ │ allocs/op │ allocs/op vs base │ VetCaascad 14.01M ± 0% 12.84M ± 0% -8.34% (p=0.002 n=6) Updates #3881. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I332b03665c96dc3df329f92007c45b03a40b92b4 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1217194 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Marcel van Lohuizen <[email protected]>
1 parent 48ec278 commit 8241d9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+88
-101
lines changed

cue/testdata/basicrewrite/018_self-reference_cycles.txtar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Unifications: 47
147147
Conjuncts: 91
148148
Disjuncts: 10
149149

150-
CloseIDElems: 12
150+
CloseIDElems: 7
151151
NumCloseIDs: 10
152152
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
153153
diff old new
@@ -173,7 +173,7 @@ diff old new
173173
+Conjuncts: 91
174174
+Disjuncts: 10
175175
+
176-
+CloseIDElems: 12
176+
+CloseIDElems: 7
177177
+NumCloseIDs: 10
178178
-- out/eval/stats --
179179
Leaks: 1

cue/testdata/benchmarks/cycleshare.txtar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Unifications: 43
3636
Conjuncts: 70
3737
Disjuncts: 21
3838

39-
CloseIDElems: 6
39+
CloseIDElems: 3
4040
NumCloseIDs: 1
4141
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
4242
diff old new
@@ -62,7 +62,7 @@ diff old new
6262
+Conjuncts: 70
6363
+Disjuncts: 21
6464
+
65-
+CloseIDElems: 6
65+
+CloseIDElems: 3
6666
+NumCloseIDs: 1
6767
-- out/eval/stats --
6868
Leaks: 8

cue/testdata/benchmarks/disjunctelim.txtar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Unifications: 22
5050
Conjuncts: 843
5151
Disjuncts: 618
5252

53-
CloseIDElems: 54
53+
CloseIDElems: 42
5454
NumCloseIDs: 3
5555
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
5656
diff old new
@@ -74,7 +74,7 @@ diff old new
7474
+Conjuncts: 843
7575
+Disjuncts: 618
7676
+
77-
+CloseIDElems: 54
77+
+CloseIDElems: 42
7878
+NumCloseIDs: 3
7979
-- out/eval/stats --
8080
Leaks: 0

cue/testdata/benchmarks/inlinedisjunction.txtar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Unifications: 16
2424
Conjuncts: 113
2525
Disjuncts: 58
2626

27-
CloseIDElems: 258
27+
CloseIDElems: 129
2828
NumCloseIDs: 23
2929
-- out/eval --
3030
(struct){
@@ -66,7 +66,7 @@ diff old new
6666
+Conjuncts: 113
6767
+Disjuncts: 58
6868
+
69-
+CloseIDElems: 258
69+
+CloseIDElems: 129
7070
+NumCloseIDs: 23
7171
-- out/eval/stats --
7272
Leaks: 0

cue/testdata/benchmarks/issue1684.txtar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Unifications: 5541
7272
Conjuncts: 25871
7373
Disjuncts: 6534
7474

75-
CloseIDElems: 41473
75+
CloseIDElems: 18527
7676
NumCloseIDs: 4115
7777
-- out/evalalpha --
7878
(struct){
@@ -159,7 +159,7 @@ diff old new
159159
+Conjuncts: 25871
160160
+Disjuncts: 6534
161161
+
162-
+CloseIDElems: 41473
162+
+CloseIDElems: 18527
163163
+NumCloseIDs: 4115
164164
-- diff/-out/evalalpha<==>+out/eval --
165165
diff old new

cue/testdata/benchmarks/issue2176.txtar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Unifications: 377
6868
Conjuncts: 1333
6969
Disjuncts: 8
7070

71-
CloseIDElems: 8382
71+
CloseIDElems: 5650
7272
NumCloseIDs: 535
7373
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
7474
diff old new
@@ -97,7 +97,7 @@ diff old new
9797
+Conjuncts: 1333
9898
+Disjuncts: 8
9999
+
100-
+CloseIDElems: 8382
100+
+CloseIDElems: 5650
101101
+NumCloseIDs: 535
102102
-- out/eval/stats --
103103
Leaks: 90

cue/testdata/benchmarks/issue3514.txtar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Unifications: 69
4646
Conjuncts: 7053
4747
Disjuncts: 2386
4848

49-
CloseIDElems: 71
49+
CloseIDElems: 35
5050
NumCloseIDs: 5733
5151
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
5252
diff old new
@@ -72,7 +72,7 @@ diff old new
7272
+Conjuncts: 7053
7373
+Disjuncts: 2386
7474
+
75-
+CloseIDElems: 71
75+
+CloseIDElems: 35
7676
+NumCloseIDs: 5733
7777
-- out/eval/stats --
7878
Leaks: 27

cue/testdata/benchmarks/issue3517.txtar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Unifications: 49
6464
Conjuncts: 123
6565
Disjuncts: 0
6666

67-
CloseIDElems: 20
67+
CloseIDElems: 12
6868
NumCloseIDs: 13
6969
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
7070
diff old new
@@ -90,7 +90,7 @@ diff old new
9090
+Conjuncts: 123
9191
+Disjuncts: 0
9292
+
93-
+CloseIDElems: 20
93+
+CloseIDElems: 12
9494
+NumCloseIDs: 13
9595
-- out/eval/stats --
9696
Leaks: 2

cue/testdata/benchmarks/listdedup.txtar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Unifications: 40
4343
Conjuncts: 98
4444
Disjuncts: 24
4545

46-
CloseIDElems: 997
46+
CloseIDElems: 541
4747
NumCloseIDs: 22
4848
-- out/evalalpha --
4949
(struct){
@@ -486,7 +486,7 @@ diff old new
486486
+Conjuncts: 98
487487
+Disjuncts: 24
488488
+
489-
+CloseIDElems: 997
489+
+CloseIDElems: 541
490490
+NumCloseIDs: 22
491491
-- out/eval/stats --
492492
Leaks: 0

cue/testdata/benchmarks/typocheck.txtar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Unifications: 703
3131
Conjuncts: 1305
3232
Disjuncts: 0
3333

34-
CloseIDElems: 43723
34+
CloseIDElems: 42120
3535
NumCloseIDs: 212
3636
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
3737
diff old new
@@ -60,7 +60,7 @@ diff old new
6060
+Conjuncts: 1305
6161
+Disjuncts: 0
6262
+
63-
+CloseIDElems: 43723
63+
+CloseIDElems: 42120
6464
+NumCloseIDs: 212
6565
-- out/eval/stats --
6666
Leaks: 0

0 commit comments

Comments
 (0)