Improving C++ Compilation Times: Tools & Techniques - Vittorio Romeo - ACCU 2023

preview_player
Показать описание

Improving C++ Compilation Times: Tools & Techniques - Vittorio Romeo - ACCU 2023

"Modules will solve everything", people say -- some optimistically, others sarcastically. However, modules are far from reaching real-world maturity, and it is still not certain whether they will improve compilation times in every situation and how costly it will be to migrate a large codebase.

Do we have to suffer with excruciating compilation times until we are able to migrate to modules? Not at all!

If you are interested in learning about practical tools and techniques to improve compilation times on codebases of any size, *today*, this talk is for you! We will cover:

How to accurately benchmark the compilation time of a codebase and detect bottlenecks;

Enabling precompiled headers in CMake, leveraging the "reuse from" feature;

Automatically transforming your build into a "unity build";

When to selectively replace heavyweight standard library headers;

General techniques to reduce physical dependencies between components.
---

Vittorio Romeo

Vittorio Romeo (B.Sc. Computer Science, 6+ YoE at Bloomberg) works on mission-critical C++ infrastructure and provides Modern C++ training to hundreds of fellow employees.

He began programming around the age of 8 and became a C++ enthusiast shortly after discovering the language. Vittorio created several open-source C++ libraries and games, published many video courses and tutorials, actively participates in the ISO C++ standardization process, and maintains the popular SFML library.

He co-authored the acclaimed "Embracing Modern C++ Safely" book (published in January 2022) with J. Lakos, R. Khlebnikov, and A. Meredith.

Vittorio is an active member of the C++ community with an ardent desire to share his knowledge and learn from others: he presented and offered workshops over 20 times at international C++ conferences (including CppCon, C++Now, ++it, ACCU, C++ On Sea, C++ Russia, and Meeting C++), covering topics of various nature.

He also maintains a website with advanced C++ articles and a YouTube channel featuring well-received modern C++11/14 tutorials. Lastly, he's active on StackOverflow, taking great care in answering interesting C++ question (90k reputation).
---

#accuconf #programming #compilation #cpp
Рекомендации по теме
Комментарии
Автор

I really liked the low-hanging fruits part. Great content, thanks

caglayandokme
Автор

Cool! Ccache looks especially appealing since I like to (vendor &) statically link all my dependencies for personal projects.

Argletrough
Автор

32:30 Empirically I have found this not to be the case. One DOES have to add Defender exclusions when using MSVC. Perhaps my MSVC is not installed in the default location?

babgab
Автор

Another topic that could potentially be discussed here is the use of code generation. I don't have any data on this, but if code generation can be used in place of a template- or macro-based code generator, then it is possible that one could see some compile time speedups.

davidsicilia
Автор

IMO, incorrect interpretation of rule of 5 and rule of 0. Think of it as is rule of 5 for definition or declaration? If it’s for declaration, then declaring constructor immediately changes the thing and you need to move copy constructor to implementation file as well.

dmitriykuragin