lukeed/tidyPublic

perf: faster XML parsing

The parser kept a table of every line break of a file, for one check
in the printer: whether two fragments of mixed content are two lines
apart. The printer now counts the breaks between them when it needs
to. The lexer reads names, quoted values and white space in tags in
runs, and the token buffer is sized from the text.

On the 16.6 MB XML corpus, a parse takes 33.0 ms instead of 44.6 ms.
The XML oracle is unchanged at 103630/104137.
LELuke Edwards authored
6f2b2f5Patch
Parent5622367
4 files changed+24-25
StackedSplit
crates/tidy/src/xml/ast.rs+0 โˆ’13
crates/tidy/src/xml/lexer.rs+8 โˆ’2
crates/tidy/src/xml/mod.rs+11 โˆ’7
crates/tidy/src/xml/print.rs+5 โˆ’3