Presented by

  • Raphaël Gomès

    Raphaël Gomès

    Raphaël is a Mercurial developer working at Octobus, a company that has collectively landed thousands of upstream changes and brought new user-facing concepts to the table. He has a hand in most of the Rust rewrite of some of Mercurial's internals, focusing on greatly improving performance. After a few years as a full-stack web developer for various private companies, he was convinced that a better calling for him was making free and open-source software that is fast and reliable. Version control systems are used by virtually every programmer, and Raphaël is now trapped with the realization that, should he stop his upstream efforts, he will simply find himself hitting the same issues with VCS he abandoned, everyday for the rest of his professional life. Hopefully, that problem will have been fixed by then; in the mean time, he will not tire in trying to make the VCS ecosystem better, be it through Mercurial or any other.


Mercurial is a Distributed Version Control System mainly written in Python. While it is often the VCS of choice for monorepos for its great scalability, certain parts remain slower than they should be. Over the past two years, an effort to rewrite parts of the Mercurial core in Rust has seen multiple significant wins in performance, even compared to C implementations. We will go over the different obstacles that Raphaël and his colleagues at Octobus faced during the rewrite of the ubiquitous `hg status`, and the solutions they came up with to make this command (and others) a lot faster. For example, running `hg status` in a Mozilla working copy moved from 1.1s to 0.04s, a ×25 improvement. Themes covered include: - Rust and Python interoperability - Fast (and slow) Rust datastructures - Fast directory traversal - Version control internals - Append-only binary formats - Mtime caching - Safe mmap usage in a concurrent context - Multithreading - Unix vs MacOS vs Windows issues