Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
templater: relax operator precedence rule to reduce possibility of la…
…rge reparse After upgrading pest from 2.7.8 to 2.7.9, I noticed CLI tests got significantly slow (something around 40sec -> 60sec on my laptop.) I suspect this would be caused by detailed error state tracking introduced in 2.7.9, but it's also true that our template grammar exercises such code path. My understanding is that PEG is basically a top down parsing with unlimited lookahead. Before this change, the default commit_summary template would be parsed as follows: 1. parse the outermost separate(..) as "term" 2. "concat" rule can't continue, so 3. reparse the whole string as "expression" Because this pattern is not uncommon, I think it's better to rewrite the grammar to avoid large retry. With this patch, our tests runs within ~50sec under debug build. It appears to save a few milliseconds in release build, but my development environment isn't quiet enough to say the difference is significant.
- Loading branch information