lukeed/tidyPublic

perf: cache widths, reuse buffers

Text docs keep their width, so fits no longer measures the same text
again and again, and tracks trailing whitespace only when a doc has a
trim. fits reuses one stack, texts that are part of the source are
borrowed instead of copied, and the arena and output reserve room up
front. Pages on one thread: 111 to 82 ms.

Adds the CLI, bench/run.ts, and its markup_fmt and @lukeed/html
helpers.
LELuke Edwards authored
3fad9efPatch
Parent13267a2
15 files changed+633-32
StackedSplit
Cargo.lock+14 โˆ’0
Cargo.toml+6 โˆ’0
bench/dprint/Cargo.lock+74 โˆ’0
bench/dprint/Cargo.toml+13 โˆ’0
bench/dprint/src/main.rs+41 โˆ’0
bench/naive.ts+53 โˆ’0
bench/run.ts+91 โˆ’0
bun.lock+5 โˆ’0
crates/tidyrs/src/doc/mod.rs+34 โˆ’9
crates/tidyrs/src/doc/print.rs+26 โˆ’17
crates/tidyrs/src/html/mod.rs+2 โˆ’2
crates/tidyrs/src/html/print.rs+18 โˆ’3
crates/tidyrs_cli/Cargo.toml+19 โˆ’0
crates/tidyrs_cli/src/main.rs+235 โˆ’0
package.json+2 โˆ’1