Large-Scale Refactoring @ Google
summary
Google builds a compiler-driven refactoring pipeline (indexer + ClangMR (clang + map reduce)) that generates, shards, formats and tests edits across a mono repo of ~100 million lines with ~4,000 C++ engineers and ~30,000 daily changes. Migrations target concrete problems not vague examples: converting 50,000 callers of old APIs, surfacing API-difference bugs, and replacing internal pointer types — the std::shared_ptr migration succeeded after making the old API a strict subset and flipping the typedef; unique_ptr work requires deeper cross-package and toolchain fixes.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 1:03What is refactoring and why it matters
- 6:22Refactoring at increasing scale
- 8:51Google's massive codebase
- 13:52Tooling for large-scale refactoring
- 17:00ClangR and refactoring pipeline
- 23:47Formatting, sharding, testing changes
- 27:37Fast-moving codebase challenges
- 30:46Case studies: shared and unique pointers
- 41:21Refactoring at scale necessity
- 42:02Q&A: Tool development
- 44:29Q&A: Static analysis and reviews
- 45:54Q&A: Prioritizing refactorings
- 47:17Q&A: Large change reviews
- 48:21Q&A: Sharding strategies
- 50:27Q&A: Tool accessibility
- 51:56Q&A: Name collisions and ODR
- 53:24Q&A: Binary compatibility
- 54:27Q&A: Legacy code refactoring
- 56:17Q&A: Year 2037 problem
related talks
39mDevelopment, Review and Integration at Google scale
01h 10mLessons in Sustainability...
39mMoving fast and staying aligned how automation powers progress
45mAdopting Kotlin at Google scale
01h 03mDeveloping C++ @ Facebook Scale
16mHow We Moved to a Monorepo
47mScaling Your Engineering System
35mFive Lines of Codes
