Skip to content

Commit b12e201

Browse files
committed
internal/core/adt: remove unused nodeContext fields
nodeContext's overlays and disjunct fields were added and set in https://cuelang.org/cl/1190800 but were never used. Peak memory usage on a simplified version of https://github.com/uhthomas/automata goes down a bit, as most of the allocations come from cloning vertices and contexts, so the size of these types is multiplied: │ old │ new │ │ peak-RSS-bytes │ peak-RSS-bytes vs base │ VetAutomataList 669.5Mi ± 3% 629.0Mi ± 3% -6.06% (p=0.000 n=8) Updates #3334. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I7ebf8db1f72cee7e4246ad10c4c0d9864ea3110e Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1213518 Reviewed-by: Marcel van Lohuizen <[email protected]> Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent e714489 commit b12e201

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

internal/core/adt/disjunct2.go

-2
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,6 @@ func (n *nodeContext) doDisjunct(c Conjunct, m defaultMode, mode runMode, orig *
476476
// a special mode, or evaluating more aggressively if finalize is not given.
477477
v.status = unprocessed
478478

479-
d.overlays = n
480-
d.disjunct = c
481479
d.scheduleConjunct(c, c.CloseInfo)
482480

483481
oc.unlinkOverlay()

internal/core/adt/eval.go

-5
Original file line numberDiff line numberDiff line change
@@ -1027,10 +1027,6 @@ type nodeContext struct {
10271027
// set for all Vertex values that were cloned.
10281028
underlying *Vertex
10291029

1030-
// overlays is set if this node is the root of a disjunct created in
1031-
// doDisjunct. It points to the direct parent nodeContext.
1032-
overlays *nodeContext
1033-
10341030
nodeContextState
10351031

10361032
scheduler
@@ -1098,7 +1094,6 @@ type nodeContext struct {
10981094
disjuncts []*nodeContext
10991095
buffer []*nodeContext
11001096
disjunctErrs []*Bottom
1101-
disjunct Conjunct
11021097

11031098
// hasDisjunction marks wither any disjunct was added. It is listed here
11041099
// instead of in nodeContextState as it should be cleared when a disjunction

0 commit comments

Comments
 (0)