lukeed/tidyPublic

perf: memoize optional chains

Expr::chain walked down the whole member chain on each call, and the
printer asks for every link, so long chains cost quadratic time; it
was a tenth of tidy's own work on the JS corpus. The file keeps each
node's answer once known, filled in one walk down the chain.
LELuke Edwards authored
7851028Patch
Parent5272ddf
2 files changed+37-10
StackedSplit
crates/tidy/src/js/ast/expr.rs+33 −10
crates/tidy/src/js/ast/mod.rs+4 −0