Lessons Learned from Adopting Header Units in Microsoft Office

Speaker: Zachary Henkel

Audience level: [ Intermediate | Advanced ]

Microsoft Office is a huge C++ codebase with nearly 100 million lines of native code. This size provides a constant challenge to build the product as quickly as possible. C++20 header units are a way to receive many of the benefits of modules, while still working with a codebase that was designed for classic header inclusion.


At CppCon 2022 it was announced that Office would investigate header units with the goal of improved build throughput. We’re excited to present the results of that work for the benefit of the C++ community at large.


In this talk Zachary Henkel, from Microsoft Office’s Core Architecture Team, and Cameron DaCamara from the MSVC front-end team will share details from the ongoing journey to adopt header units in Office’s codebase. They’ll offer the best practices that have been uncovered to date as well as pitfalls that can prevent header unit adoption. They’ll also share some of the challenging Office code that motivated header unit handling improvements in the most recent MSVC releases.