Date: Sun, 24 May 2026 14:21:04 -0700
For this round of tests I downloaded the latest versions of GCC, Clang and
MSVC. I also compared against the current Ubuntu release of GCC and Clang.
Compiler Version Module Build Module Use Include All
g++ 16.1.0 3345ms 249ms 1579ms
g++ 15.2.0 2280ms 172ms 877ms
clang 22.16.6 2014ms 52ms 1545m
clang 20.1.8 1491ms 44ms 1142ms
MSVC 19.38.33145 2058ms 81ms 1295ms
Right now none of the compilers provided submodule support that I saw for
the standard library. That means these are single threaded numbers as there
is no opportunity for parallelism. These are C++23 unoptimized builds. The
module use numbers involve importing the module and then emitting a single
trivial function that used the module.
As someone with a real-time background I wouldn't quite characterize the
module use numbers as "free." *By my calculations, if you saved all 4.4
million full-time C++ programmers 1 minute per working day for a year, it
would equate to approximately 208 entire human lives worth of time.*
Image saving 208 entire human lives from being lost staring at a compiler
output window every year. And all you have to do is shave a few
milliseconds off those numbers. We are trying to save lives here folks.
The scripts for these testes are here:
https://github.com/whatchamacallem/cxx-std-include-bench
MSVC. I also compared against the current Ubuntu release of GCC and Clang.
Compiler Version Module Build Module Use Include All
g++ 16.1.0 3345ms 249ms 1579ms
g++ 15.2.0 2280ms 172ms 877ms
clang 22.16.6 2014ms 52ms 1545m
clang 20.1.8 1491ms 44ms 1142ms
MSVC 19.38.33145 2058ms 81ms 1295ms
Right now none of the compilers provided submodule support that I saw for
the standard library. That means these are single threaded numbers as there
is no opportunity for parallelism. These are C++23 unoptimized builds. The
module use numbers involve importing the module and then emitting a single
trivial function that used the module.
As someone with a real-time background I wouldn't quite characterize the
module use numbers as "free." *By my calculations, if you saved all 4.4
million full-time C++ programmers 1 minute per working day for a year, it
would equate to approximately 208 entire human lives worth of time.*
Image saving 208 entire human lives from being lost staring at a compiler
output window every year. And all you have to do is shave a few
milliseconds off those numbers. We are trying to save lives here folks.
The scripts for these testes are here:
https://github.com/whatchamacallem/cxx-std-include-bench
Received on 2026-05-24 21:21:16
