Abstract
This talk will describe how we rebuilt our Ruby application in Rust, piece-by-piece: a class at a time! The talk will discuss the problems we faced with our Ruby code-base, how Rust would help us solve them(!), and then how we went about performing the migration in just a few months.
Last year, Deliveroo rebuilt the core of their dispatch algorithm in Rust. The dispatch algorithm allows us to plan far into the future, deciding which orders to offer to which riders in each of the cities that we operate in. The rewrite gave a massive improvement in the algorithm’s runtime (more than 17x!), which has allowed us to do explore more of the assignment search space, resulting in a more reliable customer service and shorter delivery times.
This talk will explain how we embedded Rust code in our existing Ruby application. It will discuss how and why we incrementally moved the algorithm from Ruby into Rust, rather than embarking on a from-scratch rewrite. It will describe the extensions we made to the existing tooling[0][1] for embedding Rust in Ruby, and how it allowed us maintain a clean code-base during and after the transition.