The real solution to fast compilation is to have modules. These kind of one-off hacks are interesting but will not scale.
Optimizing the unoptimizable: a journey to faster C++ compile times
11–20 of 32 posts
Re: Optimizing the unoptimizable: a journey to faster C++ compile times
#12Re: Optimizing the unoptimizable: a journey to faster C++ compile times
#13Re: Optimizing the unoptimizable: a journey to faster C++ compile times
#14The real solution to fast compilation is to have modules. These kind of one-off hacks are interesting but will not scale.
> The real solution to fast compilation is to have modules. I don't agree. The real solution for fast compilation times is to not have to recompile things. This means onboarding tools like ccache, organize your project around independent subprojects which eliminate/minimize compile-time dependencies, and leverage incremental builds. There's a C++ book somewhere that describes how the subprojects approach helps lower…
Re: Optimizing the unoptimizable: a journey to faster C++ compile times
#15The real solution to fast compilation is to have modules. These kind of one-off hacks are interesting but will not scale.
Modules is one of reasons why Pascal is fast to compile and I wish it was more popular than it was.
Re: Optimizing the unoptimizable: a journey to faster C++ compile times
#16Earlier quoted context omitted.
AFAICS the main problem is that pulls in a lot of dependencies.
Surely this is an implementation detail that vendors can change
Re: Optimizing the unoptimizable: a journey to faster C++ compile times
#17Looks like the stdio example includes compilation and linking, fmt example only times compilation.
Re: Optimizing the unoptimizable: a journey to faster C++ compile times
#18So why on earth is std::string so slow to compile, if it's possible to compile this full-featured formatting library in 1/4 of the time?
It isn't when using modules, import std brings in the whole standard C++ faster than that #include. EDIT: This compiles in 1 second on an i7 laptop. import std; int main() { std::cout
Re: Optimizing the unoptimizable: a journey to faster C++ compile times
#19The real solution to fast compilation is to have modules. These kind of one-off hacks are interesting but will not scale.
Re: Optimizing the unoptimizable: a journey to faster C++ compile times
#20The real solution to fast compilation is to have modules. These kind of one-off hacks are interesting but will not scale.
> The real solution to fast compilation is to have modules. I don't agree. The real solution for fast compilation times is to not have to recompile things. This means onboarding tools like ccache, organize your project around independent subprojects which eliminate/minimize compile-time dependencies, and leverage incremental builds. There's a C++ book somewhere that describes how the subprojects approach helps lower…