vectorcraft/crates/format/tests
Gert Pellin 37954523ae Native save: documents whose JSON is large are written compact
SaveOptions::for_doc chose pretty-printed JSON by the object count in
the layers alone. A document with few layer objects but many anchors,
or with its art in symbols, patterns or graph designs, was therefore
written pretty, about ten times the compact size: every anchor's "p",
"in" and "out" spread over several indented lines.

A document is now pretty only when it has at most PRETTY_MAX_OBJECTS
objects and its compact JSON is at most PRETTY_MAX_BYTES (1 MiB). The
size is measured by serializing into a writer that stops at the limit,
so a large document costs at most 1 MiB of extra serializing. Small
documents stay readable and diffable.

Fixes #1484
2026-10-13 06:34:12 +07:00
..
links.rs #1244: smaller objects: Node 352 -> 152 bytes, NodeKind 200 -> 80, and a cheaper undo estimate 2026-10-12 11:02:32 +07:00
native_v3.rs #1244: smaller objects: Node 352 -> 152 bytes, NodeKind 200 -> 80, and a cheaper undo estimate 2026-10-12 11:02:32 +07:00
native_v4.rs #1244: smaller objects: Node 352 -> 152 bytes, NodeKind 200 -> 80, and a cheaper undo estimate 2026-10-12 11:02:32 +07:00
prop_format.rs #1244: smaller objects: Node 352 -> 152 bytes, NodeKind 200 -> 80, and a cheaper undo estimate 2026-10-12 11:02:32 +07:00
save_options.rs Native save: documents whose JSON is large are written compact 2026-10-13 06:34:12 +07:00
streaming.rs #1244: streaming open and save, per-section limits, recovery that keeps images apart, background open 2026-10-12 11:02:33 +07:00