peepmatic: Save RHS actions as a boxed slice, not vec

A boxed slice is only two words, while a vec is three words. This should cut
down on the memory size of our automata and improve cache usage.
This commit is contained in:
Nick Fitzgerald
2020-05-07 14:14:21 -07:00
parent 210b036320
commit eb2dab0aa4
4 changed files with 44 additions and 7 deletions

View File

@@ -29,7 +29,7 @@ pub struct PeepholeOptimizations {
/// The underlying automata for matching optimizations' left-hand sides, and
/// building up the corresponding right-hand side.
pub automata: Automaton<MatchResult, MatchOp, Vec<Action>>,
pub automata: Automaton<MatchResult, MatchOp, Box<[Action]>>,
}
impl PeepholeOptimizations {