fitzgen opened Issue #1700:
During linearization, we can intern paths in the
PatternPreOrdertraversal that don't ultimately get used by any LHS match ops or RHS actions. However, we serialize the wholePathInternerwith all of its interned paths, including those unused paths. This makes the serialized form a bit bigger than it need be, and also implies a bit of memory overhead on deserialized peephole optimizations.We should add a pass to GC unused paths from the
PathInterneras part of the peepmatic compilation pipeline.
fitzgen labeled Issue #1700:
During linearization, we can intern paths in the
PatternPreOrdertraversal that don't ultimately get used by any LHS match ops or RHS actions. However, we serialize the wholePathInternerwith all of its interned paths, including those unused paths. This makes the serialized form a bit bigger than it need be, and also implies a bit of memory overhead on deserialized peephole optimizations.We should add a pass to GC unused paths from the
PathInterneras part of the peepmatic compilation pipeline.
declanvk commented on Issue #1700:
Hello again, I have a PR for this in #1795
However, I ran into an issue. I don't think the GC process is making the
PathInternerany smaller, so I'm somewhat unsure what to do. I've considered the whole list oflinear::Optimizationsas the root set ofPathIds to preserve, but I think it turns out that thePatternPreOrderdoesn't actually create any unusedPathIds.Second, given that this process involves removing a small amount of garbage (unused
PathIds) and rewriting a large amount of useful data (usedPathIds), I'm not sure if my process of refilling a separatePathInterneris the most efficient. Let me know if you have any thoughts on a better design.
fitzgen commented on Issue #1700:
Ok, that makes sense upon reflection. Thanks for looking into this. I think we can just close this issue, since I want to move away from paths and have the match predicate language implicitly bind operands to variables when doing
opcodematches.
fitzgen closed Issue #1700:
During linearization, we can intern paths in the
PatternPreOrdertraversal that don't ultimately get used by any LHS match ops or RHS actions. However, we serialize the wholePathInternerwith all of its interned paths, including those unused paths. This makes the serialized form a bit bigger than it need be, and also implies a bit of memory overhead on deserialized peephole optimizations.We should add a pass to GC unused paths from the
PathInterneras part of the peepmatic compilation pipeline.
Last updated: Dec 13 2025 at 19:03 UTC