Stream: git-wasmtime

Topic: wasmtime / Issue #1700 GC unused paths from `PathInterner`


view this post on Zulip Wasmtime GitHub notifications bot (May 14 2020 at 16:15):

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 whole PathInterner 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.

view this post on Zulip Wasmtime GitHub notifications bot (May 14 2020 at 16:15):

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 whole PathInterner 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.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 01 2020 at 00:31):

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 of linear::Optimizations as the root set of PathIds to preserve, but I think it turns out that the PatternPreOrder doesn't actually create any unused PathIds.

Second, given that this process involves removing a small amount of garbage (unused PathIds) and rewriting a large amount of useful data (used PathIds), I'm not sure if my process of refilling a separate PathInterner is the most efficient. Let me know if you have any thoughts on a better design.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 01 2020 at 00:35):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 01 2020 at 00:35):

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 whole PathInterner 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