fitzgen opened Issue #1700:
During linearization, we can intern paths in the
PatternPreOrder
traversal that don't ultimately get used by any LHS match ops or RHS actions. However, we serialize the wholePathInterner
with 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
PathInterner
as part of the peepmatic compilation pipeline.
fitzgen labeled Issue #1700:
During linearization, we can intern paths in the
PatternPreOrder
traversal that don't ultimately get used by any LHS match ops or RHS actions. However, we serialize the wholePathInterner
with 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
PathInterner
as 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
PathInterner
any smaller, so I'm somewhat unsure what to do. I've considered the whole list oflinear::Optimizations
as the root set ofPathId
s to preserve, but I think it turns out that thePatternPreOrder
doesn't actually create any unusedPathId
s.Second, given that this process involves removing a small amount of garbage (unused
PathId
s) and rewriting a large amount of useful data (usedPathId
s), I'm not sure if my process of refilling a separatePathInterner
is 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
opcode
matches.
fitzgen closed Issue #1700:
During linearization, we can intern paths in the
PatternPreOrder
traversal that don't ultimately get used by any LHS match ops or RHS actions. However, we serialize the wholePathInterner
with 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
PathInterner
as part of the peepmatic compilation pipeline.
Last updated: Dec 23 2024 at 12:05 UTC