lukeed/tidyPublic

perf: pool YAML tree storage

Nodes kept seven Vecs and Strings each, about 240 bytes. Children
and values now sit in shared pools, and comment lists and directive
parameters in a side table, so a node is about 90 bytes and building
the tree mostly stops allocating. Line lookups start at the last line,
and attach no longer allocates per node.

The 452 KB vite lockfile formats in 14.0 ms instead of 20.3 ms, with
104K allocations instead of 240K.
LELuke Edwards authored
c7e9027Patch
Parentbc2265e
8 files changed+404-274
StackedSplit
crates/tidy/src/toml/tree.rs+1 โˆ’0
crates/tidy/src/yaml/ast.rs+164 โˆ’36
crates/tidy/src/yaml/attach.rs+27 โˆ’30
crates/tidy/src/yaml/mod.rs+4 โˆ’0
crates/tidy/src/yaml/print.rs+76 โˆ’76
crates/tidy/src/yaml/transform.rs+119 โˆ’119
crates/tidy/tests/yaml.rs+3 โˆ’3
tests/oracle/yaml/src/main.rs+10 โˆ’10