You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hold the L4 result with integer keys instead of strings #89
Is your feature request related to a problem? Please describe.
Follow-up to #62. The L4 result (sdg.Result) stays in memory until the Neo4j push finishes its second pass. On gitea v1.25.3, --emit neo4j in a 16 GB container now peaks at 13.8 GiB, against the 14 GiB target (#87). The peak comes during the second push pass, while the L4 result is still in memory, so the margin is 0.2 GiB.
The largest live allocations after the analysis are all L4 (gitea heap profile, #62):
PortEdge, Vertex and SummaryEdge (internal/sdg/ir.go) hold their keys as strings, each built separately, for example c12/actual_in:0.
Describe the solution you'd like
Store the keys as uint32 indices into a per-callable key table, and intern Var and Of.
The emitter's l4Overlay (emit/emit_l4.go) turns the indices back into keys while it writes a module.
No output change: analysis.json and graph.cypher stay byte-identical, and TestSDG_OutputUnchangedByMemoryLevers and the Neo4j stream parity tests stay green.
Measure gitea's peak before and after with the memory test (-tags memtest).
Estimated gain: 1.5 to 2.5 GB of gitea's 5.3 GB L4 result. This is an estimate, not a measurement. The change touches about four files in internal/sdg, plus l4Overlay and the sdg tests that build IR literals.
Describe alternatives you've considered
Stream the L4 result per callable instead of building it up front. Rejected: param edges and summaries are whole-program facts (computed in SCC order), so this is a redesign of internal/sdg.
Activity