How to break an ABI and keep your users happy
summary
Google had long used a custom global string implementation (copy‑on‑write vs SSO) that costs about 2% slowdown and becomes unmanageable across a growing codebase (from ~1M to 150M LOC over the years). The team auto‑refactors sources (half a year) and builds the standard library twice with different inline namespaces, producing a fat standard library that contains both ABIs so old prebuilt binaries keep working; it succeeds at compatibility but doubles library size and is acknowledged as a suboptimal, temporary fix.
AI-written summary · about
chapters (35)
- 0:00Introduction to the topic
- 1:33History of string classes
- 2:51Copy-on-write limitations
- 3:55Small string optimization
- 5:04Inline namespaces explained
- 6:16Understanding ABI vs API
- 7:15Google C++ history
- 8:23The COW string problem
- 9:45Moving to standard libraries
- 10:33The impostor string solution
- 11:47Lessons from the impostor
- 12:48Dependencies and performance
- 14:05The hidden string piece
- 15:32Fixing the global namespace
- 16:25Open sourcing common libraries
- 17:37Replacing standard string
- 18:51Serving two masters
- 20:14The technical solution
- 21:53Lessons in design
- 22:52Mistakes are inevitable
- 23:42Fail faster
- 24:37Design for change
- 25:29API contracts
- 26:26Avoiding forward declaration
- 27:40Defining behavior
- 28:35Function contracts
- 29:43ABI and memory layout
- 30:58ABI and virtual tables
- 32:19Calling conventions
- 33:02Mangled names
- 34:22Innocent changes
- 35:10Summary of ABI stability
- 35:45Binary break preparation
- 37:06Pimpl idiom
- 37:45Q&A and conclusion
related talks
01h 29mC++ API & ABI versioning
39mWhat Is an ABI, and Why Should You Care?
01h 06mWhat is an ABI, and Why is Breaking it Bad?
01h 35mImpact on maintainability and refactoring for higher-level design features
01h 09mABI Stability Strikes Back
01h 00mLarge-Scale Changes at Google: Lessons Learned From 5 Yrs of Mass Migrations
59mSoftware Engineering Is About Tradeoffs
40mHow to Build Binary-Compatible APIs in Compiled Languages?
