r/cpp • u/tartaruga232 MSVC user, r/cpp_modules • Apr 21 '26
Uneeded Recompilations When Using Partitions
https://abuehl.github.io/2026/04/20/unneeded-recompilations-when-using-partitions.htmlThis blog posting from me about C++ modules explains in detail what causes unneeded recompilations using detailed code examples from the sources of our UML Editor.
It's a precise description and a showcase of what's the status quo in the C++ standard.
Quote from the posting:
The C++ language currently lacks a concise and easy to use alternative for explicitly expressing the minimally required dependencies on partitions.
(Note: All code examples shown or linked from the text are 100% standard conformant.)
Thanks in advance for comments. Please ask if you do not understand anything or anything is unclear. I would appreciate if you could leave a comment if you don't like anything. Thanks for reading!
View all comments
Show parent comment
4
u/current_thread Apr 21 '26 edited Apr 21 '26
All of them are barely 50 to 100 lines. Why the need for splitting them up this granularly? In my game engine my
VulkanDevice.cpphas roughly 4000 lines of code and I'd argue it's still maintainable.I roughly agree on the name clashes, in the beginning I thought they'd work similar to header/ CPP pairs (which MSVC allows). Again, I'd be curious to hear some people who actually standardized this chime in to understand why it was designed this way. Similarly I'd love for some build tool maintainers (like the CMake folks) to chime in and explain if the uniqueness constraint is vital to how their system works.
If you've collected enough feedback from the affected parties and gotten the green light you can go ahead and write a paper to get your desired change standardized.
For me though it feels like a non-issue. My codebase has roughly 250 module files with 35 First-Party modules (so discounting wrapper modules I like to use). I've had many many many many problems with them, but the internal partition naming is not one of them.