lukeed/tidyPublic

perf: reuse the token buffer

The lexer allocated its token array for each file, often several MB,
then grew it and freed it. Formatter now keeps it like its other
buffers. About 2.4%, mostly system time.
LELuke Edwards authored
2815516Patch
Parent9de9a0f
4 files changed+20-9
StackedSplit
crates/tidyrs/src/html/ast.rs+2 โˆ’0
crates/tidyrs/src/html/lexer.rs+9 โˆ’6
crates/tidyrs/src/html/mod.rs+4 โˆ’1
crates/tidyrs/src/html/parser.rs+5 โˆ’2