CQCL / hugr

Hierarchical Unified Graph Representation for quantum and classical programs
https://crates.io/crates/hugr
Apache License 2.0
16 stars 4 forks source link

Add compression/decompression to serialisation #1307

Open doug-q opened 1 month ago

doug-q commented 1 month ago

When we start to add DebugInfo to Hugrs we will see an explosion in the size of serialised JSON.

Add a binary format which is compressed JSON, with some small header identifying it. Suggest https://docs.rs/zstd/latest/zstd/ and/or https://crates.io/crates/flate2

aborgna-q commented 1 month ago

It may be useful to export a load_hugr helper that automatically detects the file format (with https://crates.io/crates/infer), and decompresses/deserialises it as needed.