C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Benchmarking Including The C++ Standard Library

From: Andrey Semashev <andrey.semashev_at_[hidden]>
Date: Fri, 22 May 2026 12:44:39 +0300
On 22 May 2026 11:12, Jens Maurer via Std-Proposals wrote:
>
> On 5/22/26 03:14, Adrian Johnston via Std-Proposals wrote:
>>
>>>> But reorganizing headers at all seems kind of backwards when we have modules.
>>
>> The reality is that our current compilers still need to take the time to update their internal symbol tables with the entire contents of the module, so writing *import std;* might just kill the compile time of a large project across hundreds of files. It would make more sense to import only the standard library submodules needed as that might be faster. So we still have the problem, it is just less bad in some cases now.
>>
>> I spent a lot of time refactoring my codebase to work as a module after the response on this list and it loads slower than the textual inclusion of select headers. So I'm kind of burnt out on the topic after that, but I can do more benchmarking if anyone would like me to.
>
> The sales story for modules is that "import std" is fast.
> Can you share some benchmark figures for the build time of
>
> import std;
>
> int main() {}
>
> Make sure to read your compiler's documentation on modules;
> it is likely that you need a once-only pre-generation step
> to actually build the "std" module. That shouldn't factor
> into the benchmark timings.

Why shouldn't it? It's going to be built every time on CI.

Received on 2026-05-22 09:44:44