Skip to content

Commit 930a98b

Browse files
committed
cue/stats: remove unused CloseIDElems counter
The CloseIDElems counter was tracking the size of ReqSet during closedness checks, upcoming changes make this counter deprecated. We remove it to minimize diff. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ia93cd81406c4aed59215a032f84bdbf0a0f4e945 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1218833 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 0ccf38c commit 930a98b

File tree

4 files changed

+1
-9
lines changed

4 files changed

+1
-9
lines changed

cmd/cue/cmd/testdata/script/stats.txtar

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ contents overwritten
5050
"Disjuncts": 2,
5151
"Notifications": 0,
5252
"Conjuncts": 8,
53-
"CloseIDElems": 0,
5453
"NumCloseIDs": 2,
5554
"ConjunctInfos": 6,
5655
"MaxConjunctInfos": 2,
@@ -72,7 +71,6 @@ CUE: {
7271
Disjuncts: 2
7372
Notifications: 0
7473
Conjuncts: 8
75-
CloseIDElems: 0
7674
NumCloseIDs: 2
7775
ConjunctInfos: 6
7876
MaxConjunctInfos: 2
@@ -93,7 +91,6 @@ CUE:
9391
Disjuncts: 2
9492
Notifications: 0
9593
Conjuncts: 8
96-
CloseIDElems: 0
9794
NumCloseIDs: 2
9895
ConjunctInfos: 6
9996
MaxConjunctInfos: 2
@@ -113,7 +110,6 @@ Go:
113110
"Disjuncts": 2,
114111
"Notifications": 0,
115112
"Conjuncts": 8,
116-
"CloseIDElems": 0,
117113
"NumCloseIDs": 2,
118114
"ConjunctInfos": 6,
119115
"MaxConjunctInfos": 2,

cue/stats/stats.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ type Counts struct {
7070
Conjuncts int64
7171

7272
// Typo checking counters
73-
CloseIDElems int64 // Size of ReqSet
7473
NumCloseIDs int64 // Number of close IDs used
7574
ConjunctInfos int64 // Number of conjunct infos created
7675
MaxConjunctInfos int64 // Maximum number of conjunct infos in a node
@@ -114,7 +113,6 @@ func (c *Counts) Add(other Counts) {
114113
c.Disjuncts += other.Disjuncts
115114
c.Notifications += other.Notifications
116115

117-
c.CloseIDElems += other.CloseIDElems
118116
c.NumCloseIDs += other.NumCloseIDs
119117
c.ConjunctInfos += other.ConjunctInfos
120118
if other.MaxConjunctInfos > c.MaxConjunctInfos {
@@ -135,7 +133,6 @@ func (c Counts) Since(start Counts) Counts {
135133
c.Conjuncts -= start.Conjuncts
136134
c.Disjuncts -= start.Disjuncts
137135
c.Notifications -= start.Notifications
138-
c.CloseIDElems -= start.CloseIDElems
139136
c.NumCloseIDs -= start.NumCloseIDs
140137

141138
c.ConjunctInfos -= start.ConjunctInfos

internal/core/adt/eval_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func runEvalTest(t *cuetxtar.Test, version internal.EvaluatorVersion, dbg cuedeb
138138
counts.Disjuncts > 20,
139139
orig.Conjuncts > counts.Conjuncts*2,
140140
counts.Notifications > 10,
141-
counts.CloseIDElems > 1000,
141+
counts.NumCloseIDs > 100,
142142
counts.Leaks()-orig.Leaks() > 17,
143143
counts.Allocs-orig.Allocs > 50:
144144
// For now, we only care about disjuncts.

internal/core/adt/typocheck.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,6 @@ func (a *reqSets) replaceIDs(ctx *OpContext, b ...replaceID) {
816816

817817
for qIdx := 0; qIdx < len(queue); qIdx++ {
818818
currentSet := queue[qIdx]
819-
ctx.stats.CloseIDElems++
820819

821820
for _, nextID := range index[currentSet.id].replacements {
822821
if !index[nextID].delete && !visited.Has(nextID) {

0 commit comments

Comments
 (0)