# Performance Ideas
The current macro already emits a branch-ordered decision tree, but the following tweaks would shave extra instructions from the hot path:
1. **Unchecked Access:** Replace `candidate.get(depth)` with:
```rust
if len <= depth {
len == depth && terminal
} else {
let byte = unsafe { *candidate.get_unchecked(depth) };
match byte { ... }
}
```
This keeps the bounds check but removes the `Option` construction.
2. **Single-Child Nodes:** When a node has exactly one edge, emit a simple `if byte == X { ... } else { false }` rather than a two-arm `match`.
3. **Linear Tail Collapse:** Recognize long chains with no branching and emit a single `candidate.len() == depth + k && candidate[depth..] == [..]` comparison to avoid repeated byte dispatch.
Each idea preserves the zero-allocation property while reducing instruction count for tight loops.