Files
codeql/misc
Taus 9516861c71 yeast: Use SmallVec<[Id; 1]> for rule output
Every rule firing returned `Vec<Id>` even though the overwhelming
majority of rules produce a single replacement node. Switch the
Transform return type, try_rule, apply_rules, and apply_rules_inner
to `RuleOutput = SmallVec<[Id; 1]>`. Re-export `smallvec` and
`SmallVec` from the yeast crate so generated rule! macro code can
refer to them by short paths.

For the rule! macro, generate `yeast::smallvec![__id]` for the
shorthand form and `yeast::RuleOutput = yeast::SmallVec::new()` for
the full template form, so rule outputs stay inline for the common
single-Id case.

Per-firing memory: a Vec allocation per rule firing turns into zero
when the rule produces 0 or 1 Ids. Rules that produce multiple Ids
still allocate (SmallVec spills to heap when the inline buffer is
exceeded), unchanged from before.
2026-05-08 12:50:20 +00:00
..
2019-02-15 10:41:17 +00:00