Skip to content

Commit f389502

Browse files
committed
internal/core/adt: trigger more diffs in stats
Now we have memory management added, we can trigger more differences based on leaks and allocations. Before, as all allocations were leaks, we did not trigger on these differences, as this would result in too much noise. Issue #3334 Issue #2850 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I89c8bfe8a58529d3967fb5e723c1fdde2e8191f7 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1218187 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent fb4f507 commit f389502

File tree

11 files changed

+390
-1
lines changed

11 files changed

+390
-1
lines changed

cue/testdata/benchmarks/issue3307.txtar

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,45 @@ if _request.enabled {
2222
}
2323

2424
_request: enabled: _
25+
-- out/evalalpha/stats --
26+
Leaks: 18
27+
Freed: 3
28+
Reused: 0
29+
Allocs: 21
30+
Retain: 0
31+
32+
Unifications: 21
33+
Conjuncts: 21
34+
Disjuncts: 0
35+
36+
CloseIDElems: 1
37+
NumCloseIDs: 1
38+
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
39+
diff old new
40+
--- old
41+
+++ new
42+
@@ -1,12 +1,12 @@
43+
-Leaks: 0
44+
-Freed: 21
45+
-Reused: 16
46+
-Allocs: 5
47+
-Retain: 72
48+
+Leaks: 18
49+
+Freed: 3
50+
+Reused: 0
51+
+Allocs: 21
52+
+Retain: 0
53+
54+
Unifications: 21
55+
-Conjuncts: 3
56+
-Disjuncts: 93
57+
-
58+
-CloseIDElems: 0
59+
+Conjuncts: 21
60+
+Disjuncts: 0
61+
+
62+
+CloseIDElems: 1
63+
NumCloseIDs: 1
2564
-- out/eval/stats --
2665
Leaks: 0
2766
Freed: 21

cue/testdata/builtins/matchif.txtar

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,42 @@ regularFields: {
1010
err3: {x: 2, y: 5}
1111
err4: {x: 1, y: 2}
1212
}
13+
-- out/evalalpha/stats --
14+
Leaks: 64
15+
Freed: 58
16+
Reused: 46
17+
Allocs: 76
18+
Retain: 0
19+
20+
Unifications: 98
21+
Conjuncts: 154
22+
Disjuncts: 0
23+
24+
CloseIDElems: 24
25+
NumCloseIDs: 48
26+
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
27+
diff old new
28+
--- old
29+
+++ new
30+
@@ -1,9 +1,12 @@
31+
-Leaks: 24
32+
-Freed: 74
33+
-Reused: 69
34+
-Allocs: 29
35+
-Retain: 24
36+
+Leaks: 64
37+
+Freed: 58
38+
+Reused: 46
39+
+Allocs: 76
40+
+Retain: 0
41+
42+
Unifications: 98
43+
Conjuncts: 154
44+
-Disjuncts: 98
45+
+Disjuncts: 0
46+
+
47+
+CloseIDElems: 24
48+
+NumCloseIDs: 48
1349
-- out/eval/stats --
1450
Leaks: 24
1551
Freed: 74

cue/testdata/choosedefault/002_associativity_of_defaults.txtar

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,45 @@ c: *"a" | *"b" | "c"
155155
}
156156
}
157157
}
158+
-- out/evalalpha/stats --
159+
Leaks: 30
160+
Freed: 352
161+
Reused: 326
162+
Allocs: 56
163+
Retain: 0
164+
165+
Unifications: 62
166+
Conjuncts: 466
167+
Disjuncts: 278
168+
169+
CloseIDElems: 1
170+
NumCloseIDs: 101
171+
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
172+
diff old new
173+
--- old
174+
+++ new
175+
@@ -1,9 +1,12 @@
176+
-Leaks: 0
177+
-Freed: 382
178+
-Reused: 370
179+
-Allocs: 12
180+
-Retain: 1
181+
-
182+
-Unifications: 104
183+
-Conjuncts: 516
184+
-Disjuncts: 383
185+
+Leaks: 30
186+
+Freed: 352
187+
+Reused: 326
188+
+Allocs: 56
189+
+Retain: 0
190+
+
191+
+Unifications: 62
192+
+Conjuncts: 466
193+
+Disjuncts: 278
194+
+
195+
+CloseIDElems: 1
196+
+NumCloseIDs: 101
158197
-- out/eval/stats --
159198
Leaks: 0
160199
Freed: 382

cue/testdata/comprehensions/issue3762.txtar

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,48 @@ reference: {
7777
ok: true
7878
}
7979
}
80+
-- out/evalalpha/stats --
81+
Leaks: 23
82+
Freed: 57
83+
Reused: 45
84+
Allocs: 35
85+
Retain: 0
86+
87+
Unifications: 71
88+
Conjuncts: 107
89+
Disjuncts: 0
90+
91+
CloseIDElems: 55
92+
NumCloseIDs: 25
93+
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
94+
diff old new
95+
--- old
96+
+++ new
97+
@@ -1,12 +1,12 @@
98+
-Leaks: 4
99+
-Freed: 63
100+
-Reused: 55
101+
-Allocs: 12
102+
-Retain: 11
103+
-
104+
-Unifications: 67
105+
-Conjuncts: 88
106+
-Disjuncts: 74
107+
-
108+
-CloseIDElems: 0
109+
-NumCloseIDs: 10
110+
+Leaks: 23
111+
+Freed: 57
112+
+Reused: 45
113+
+Allocs: 35
114+
+Retain: 0
115+
+
116+
+Unifications: 71
117+
+Conjuncts: 107
118+
+Disjuncts: 0
119+
+
120+
+CloseIDElems: 55
121+
+NumCloseIDs: 25
80122
-- out/eval/stats --
81123
Leaks: 4
82124
Freed: 63

cue/testdata/cycle/compbottom2.txtar

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,48 @@ issue3838: {
329329
_test: assert: invoke: "foo"
330330
}).results
331331
}
332+
-- out/evalalpha/stats --
333+
Leaks: 42
334+
Freed: 190
335+
Reused: 175
336+
Allocs: 57
337+
Retain: 0
338+
339+
Unifications: 206
340+
Conjuncts: 343
341+
Disjuncts: 16
342+
343+
CloseIDElems: 121
344+
NumCloseIDs: 112
345+
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
346+
diff old new
347+
--- old
348+
+++ new
349+
@@ -1,12 +1,12 @@
350+
-Leaks: 13
351+
-Freed: 223
352+
-Reused: 214
353+
-Allocs: 22
354+
-Retain: 104
355+
-
356+
-Unifications: 220
357+
-Conjuncts: 279
358+
-Disjuncts: 302
359+
-
360+
-CloseIDElems: 0
361+
-NumCloseIDs: 57
362+
+Leaks: 42
363+
+Freed: 190
364+
+Reused: 175
365+
+Allocs: 57
366+
+Retain: 0
367+
+
368+
+Unifications: 206
369+
+Conjuncts: 343
370+
+Disjuncts: 16
371+
+
372+
+CloseIDElems: 121
373+
+NumCloseIDs: 112
332374
-- out/eval/stats --
333375
Leaks: 13
334376
Freed: 223

cue/testdata/cycle/compbottomnofinal.txtar

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,48 @@ large: {
356356
}
357357
}
358358
}
359+
-- out/evalalpha/stats --
360+
Leaks: 44
361+
Freed: 76
362+
Reused: 58
363+
Allocs: 62
364+
Retain: 0
365+
366+
Unifications: 120
367+
Conjuncts: 140
368+
Disjuncts: 0
369+
370+
CloseIDElems: 20
371+
NumCloseIDs: 76
372+
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
373+
diff old new
374+
--- old
375+
+++ new
376+
@@ -1,12 +1,12 @@
377+
-Leaks: 10
378+
-Freed: 105
379+
-Reused: 95
380+
-Allocs: 20
381+
-Retain: 302
382+
-
383+
-Unifications: 115
384+
-Conjuncts: 244
385+
-Disjuncts: 215
386+
-
387+
-CloseIDElems: 0
388+
-NumCloseIDs: 48
389+
+Leaks: 44
390+
+Freed: 76
391+
+Reused: 58
392+
+Allocs: 62
393+
+Retain: 0
394+
+
395+
+Unifications: 120
396+
+Conjuncts: 140
397+
+Disjuncts: 0
398+
+
399+
+CloseIDElems: 20
400+
+NumCloseIDs: 76
359401
-- out/eval/stats --
360402
Leaks: 10
361403
Freed: 105

cue/testdata/eval/bounds.txtar

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,41 @@ nonConcrete: {
212212
eErr6: ==_int
213213
eErr6: "foo"
214214
}
215+
-- out/evalalpha/stats --
216+
Leaks: 0
217+
Freed: 191
218+
Reused: 134
219+
Allocs: 57
220+
Retain: 0
221+
222+
Unifications: 191
223+
Conjuncts: 351
224+
Disjuncts: 0
225+
226+
CloseIDElems: 0
227+
NumCloseIDs: 4
228+
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
229+
diff old new
230+
--- old
231+
+++ new
232+
@@ -1,9 +1,12 @@
233+
Leaks: 0
234+
Freed: 191
235+
-Reused: 186
236+
-Allocs: 5
237+
-Retain: 7
238+
+Reused: 134
239+
+Allocs: 57
240+
+Retain: 0
241+
242+
Unifications: 191
243+
-Conjuncts: 511
244+
-Disjuncts: 200
245+
+Conjuncts: 351
246+
+Disjuncts: 0
247+
+
248+
+CloseIDElems: 0
249+
+NumCloseIDs: 4
215250
-- out/eval/stats --
216251
Leaks: 0
217252
Freed: 191

cue/testdata/eval/disjunctions.txtar

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,48 @@ issue3891: full: {
318318
foo: *_input.sub1.sub2 | _
319319
}
320320
}
321+
-- out/evalalpha/stats --
322+
Leaks: 90
323+
Freed: 585
324+
Reused: 518
325+
Allocs: 157
326+
Retain: 0
327+
328+
Unifications: 294
329+
Conjuncts: 810
330+
Disjuncts: 241
331+
332+
CloseIDElems: 231
333+
NumCloseIDs: 132
334+
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
335+
diff old new
336+
--- old
337+
+++ new
338+
@@ -1,12 +1,12 @@
339+
-Leaks: 40
340+
-Freed: 837
341+
-Reused: 825
342+
-Allocs: 52
343+
-Retain: 130
344+
-
345+
-Unifications: 506
346+
-Conjuncts: 1619
347+
-Disjuncts: 936
348+
-
349+
-CloseIDElems: 0
350+
-NumCloseIDs: 2
351+
+Leaks: 90
352+
+Freed: 585
353+
+Reused: 518
354+
+Allocs: 157
355+
+Retain: 0
356+
+
357+
+Unifications: 294
358+
+Conjuncts: 810
359+
+Disjuncts: 241
360+
+
361+
+CloseIDElems: 231
362+
+NumCloseIDs: 132
321363
-- out/eval/stats --
322364
Leaks: 40
323365
Freed: 837

0 commit comments

Comments
 (0)