Skip to content

Commit 971ee4f

Browse files
committed
internal/core/adt: filter notifications
Unconditionally adding a node for notifications is costly. "Popular" schema can easily get into the thousands of notifications. As long as all conjuncts are known, there is really no need to register the schema for notification. To detect this is straightforward: if all ancestors have been processed, and the parent of a schema has computed all tasks that can compute field conjuncts, all conjuncts are known. We also lower the trigger to include diffs for notifications to 10 Notifications. This adds a couple of files. Issue #3334 Issue #2850 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Iee6f4342295d87ebfd5b8ac1a0a3e5f5f60f0d1b Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1218273 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 18b7df0 commit 971ee4f

Some content is hidden

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

64 files changed

+176
-162
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,14 @@ Retain: 0
146146
Unifications: 47
147147
Conjuncts: 91
148148
Disjuncts: 10
149-
Notifications: 3
150149

151150
CloseIDElems: 7
152151
NumCloseIDs: 10
153152
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
154153
diff old new
155154
--- old
156155
+++ new
157-
@@ -1,9 +1,13 @@
156+
@@ -1,9 +1,12 @@
158157
-Leaks: 1
159158
-Freed: 57
160159
-Reused: 46
@@ -173,7 +172,6 @@ diff old new
173172
+Unifications: 47
174173
+Conjuncts: 91
175174
+Disjuncts: 10
176-
+Notifications: 3
177175
+
178176
+CloseIDElems: 7
179177
+NumCloseIDs: 10

cue/testdata/benchmarks/issue2176.txtar

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,14 @@ Retain: 0
6767
Unifications: 375
6868
Conjuncts: 1332
6969
Disjuncts: 8
70-
Notifications: 35
7170

7271
CloseIDElems: 5337
7372
NumCloseIDs: 535
7473
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
7574
diff old new
7675
--- old
7776
+++ new
78-
@@ -1,12 +1,13 @@
77+
@@ -1,12 +1,12 @@
7978
-Leaks: 90
8079
-Freed: 684
8180
-Reused: 680
@@ -97,7 +96,6 @@ diff old new
9796
+Unifications: 375
9897
+Conjuncts: 1332
9998
+Disjuncts: 8
100-
+Notifications: 35
10199
+
102100
+CloseIDElems: 5337
103101
+NumCloseIDs: 535

cue/testdata/benchmarks/issue3334.txtar

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,14 @@ Retain: 0
5252
Unifications: 452
5353
Conjuncts: 797
5454
Disjuncts: 310
55-
Notifications: 21
5655

5756
CloseIDElems: 0
5857
NumCloseIDs: 21
5958
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
6059
diff old new
6160
--- old
6261
+++ new
63-
@@ -1,9 +1,13 @@
62+
@@ -1,9 +1,12 @@
6463
Leaks: 0
6564
-Freed: 401
6665
-Reused: 388
@@ -78,7 +77,6 @@ diff old new
7877
+Unifications: 452
7978
+Conjuncts: 797
8079
+Disjuncts: 310
81-
+Notifications: 21
8280
+
8381
+CloseIDElems: 0
8482
+NumCloseIDs: 21

cue/testdata/benchmarks/issue3514.txtar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Retain: 0
4545
Unifications: 50
4646
Conjuncts: 7010
4747
Disjuncts: 2362
48-
Notifications: 2287
48+
Notifications: 2
4949

5050
CloseIDElems: 35
5151
NumCloseIDs: 5733
@@ -72,7 +72,7 @@ diff old new
7272
+Unifications: 50
7373
+Conjuncts: 7010
7474
+Disjuncts: 2362
75-
+Notifications: 2287
75+
+Notifications: 2
7676
+
7777
+CloseIDElems: 35
7878
+NumCloseIDs: 5733

cue/testdata/benchmarks/issue3517.txtar

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,14 @@ Retain: 0
6363
Unifications: 45
6464
Conjuncts: 119
6565
Disjuncts: 0
66-
Notifications: 1
6766

6867
CloseIDElems: 12
6968
NumCloseIDs: 13
7069
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
7170
diff old new
7271
--- old
7372
+++ new
74-
@@ -1,9 +1,13 @@
73+
@@ -1,9 +1,12 @@
7574
-Leaks: 2
7675
-Freed: 49
7776
-Reused: 39
@@ -90,7 +89,6 @@ diff old new
9089
+Unifications: 45
9190
+Conjuncts: 119
9291
+Disjuncts: 0
93-
+Notifications: 1
9492
+
9593
+CloseIDElems: 12
9694
+NumCloseIDs: 13

cue/testdata/benchmarks/listdedup.txtar

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ Retain: 0
4242
Unifications: 33
4343
Conjuncts: 91
4444
Disjuncts: 24
45-
Notifications: 2
4645

4746
CloseIDElems: 541
4847
NumCloseIDs: 22
@@ -467,7 +466,7 @@ diff old new
467466
diff old new
468467
--- old
469468
+++ new
470-
@@ -1,9 +1,13 @@
469+
@@ -1,9 +1,12 @@
471470
Leaks: 0
472471
-Freed: 24096
473472
-Reused: 24051
@@ -485,7 +484,6 @@ diff old new
485484
+Unifications: 33
486485
+Conjuncts: 91
487486
+Disjuncts: 24
488-
+Notifications: 2
489487
+
490488
+CloseIDElems: 541
491489
+NumCloseIDs: 22

cue/testdata/benchmarks/sharefg.txtar

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,14 @@ Retain: 0
119119
Unifications: 452
120120
Conjuncts: 845
121121
Disjuncts: 0
122-
Notifications: 56
123122

124123
CloseIDElems: 0
125124
NumCloseIDs: 238
126125
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
127126
diff old new
128127
--- old
129128
+++ new
130-
@@ -1,9 +1,13 @@
129+
@@ -1,9 +1,12 @@
131130
-Leaks: 112
132131
-Freed: 340
133132
-Reused: 308
@@ -144,7 +143,6 @@ diff old new
144143
-Disjuncts: 720
145144
+Conjuncts: 845
146145
+Disjuncts: 0
147-
+Notifications: 56
148146
+
149147
+CloseIDElems: 0
150148
+NumCloseIDs: 238

cue/testdata/benchmarks/typocheck.txtar

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,14 @@ Retain: 0
3030
Unifications: 700
3131
Conjuncts: 1302
3232
Disjuncts: 0
33-
Notifications: 3
3433

3534
CloseIDElems: 42120
3635
NumCloseIDs: 212
3736
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
3837
diff old new
3938
--- old
4039
+++ new
41-
@@ -1,12 +1,13 @@
40+
@@ -1,12 +1,12 @@
4241
Leaks: 0
4342
Freed: 700
4443
-Reused: 594
@@ -55,7 +54,6 @@ diff old new
5554
-CloseIDElems: 0
5655
-NumCloseIDs: 4
5756
+Disjuncts: 0
58-
+Notifications: 3
5957
+
6058
+CloseIDElems: 42120
6159
+NumCloseIDs: 212

cue/testdata/builtins/056_issue314.txtar

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,14 @@ Retain: 0
8383
Unifications: 21
8484
Conjuncts: 24
8585
Disjuncts: 0
86-
Notifications: 1
8786

8887
CloseIDElems: 6
8988
NumCloseIDs: 3
9089
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
9190
diff old new
9291
--- old
9392
+++ new
94-
@@ -1,9 +1,13 @@
93+
@@ -1,9 +1,12 @@
9594
Leaks: 0
9695
-Freed: 45
9796
-Reused: 39
@@ -109,7 +108,6 @@ diff old new
109108
+Unifications: 21
110109
+Conjuncts: 24
111110
+Disjuncts: 0
112-
+Notifications: 1
113111
+
114112
+CloseIDElems: 6
115113
+NumCloseIDs: 3

cue/testdata/builtins/closed.txtar

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,14 @@ Retain: 0
101101
Unifications: 183
102102
Conjuncts: 298
103103
Disjuncts: 6
104-
Notifications: 35
105104

106105
CloseIDElems: 525
107106
NumCloseIDs: 88
108107
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
109108
diff old new
110109
--- old
111110
+++ new
112-
@@ -1,9 +1,13 @@
111+
@@ -1,9 +1,12 @@
113112
-Leaks: 61
114113
-Freed: 214
115114
-Reused: 208
@@ -128,7 +127,6 @@ diff old new
128127
+Unifications: 183
129128
+Conjuncts: 298
130129
+Disjuncts: 6
131-
+Notifications: 35
132130
+
133131
+CloseIDElems: 525
134132
+NumCloseIDs: 88

0 commit comments

Comments
 (0)