
Shopify Engineering · 10 min readRust
TreeWalker: Avoiding redundant work across rows and trees
TreeWalker speeds up delivery-date predictions by sharing decision‑tree evaluations across rows that share constant features. Implemented in Rust, it uses row masks and prepared predicate masks to avoid redundant work, achieving nearly four‑times faster inference than the previous evaluator.
- Row masks let multiple rows be processed together, reducing repeated branch evaluations
- Prepared predicate masks reuse answers for identical feature tests across many trees
- Rust implementation focuses on cache‑friendly data layouts and minimal branching for speed