Skip to content

Improve PTP_SerializedEgraph serialization efficiency#70

Draft
FTRobbin wants to merge 20 commits into
PTP_SerializeEgraphfrom
haobin-serialize-prime
Draft

Improve PTP_SerializedEgraph serialization efficiency#70
FTRobbin wants to merge 20 commits into
PTP_SerializeEgraphfrom
haobin-serialize-prime

Conversation

@FTRobbin

@FTRobbin FTRobbin commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

A breakdown of the serialized egraph shows that the frontend data structures produce a significant overhead (~40%) in the serialization size, which is about 20x the input file size.

The root of the problem is twofold: (1) the frontend data structures themselves are verbose because they are ASTs with lots of annotations; (2) our serialized representation is also bloated because of serde.

This PR has not addressed those two problems. However, under the assumption that only extractions are done at serve time, egraph.rulesets and egraph.overall_run_report are not used and thus can be skipped during serialization/deserialization. On a few samples I tried locally, this reduces the overall size of the serialized egraph by ~25%.

I'm putting up this PR to see how far this will get us.

A follow-up PR will add more size-related statistics to the nightly report so we can more easily see global improvements.

@FTRobbin FTRobbin requested a review from ajpal June 4, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants