C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Benchmarking using the standard library as a module

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Tue, 26 May 2026 22:57:47 +0100
On Tue, 26 May 2026 at 22:20, Adrian Johnston <ajohnston4536_at_[hidden]>
wrote:

>
> Simply calling *fork()* in the compiler was my favorite response so far.
> If the world moves towards *import std;* everywhere I think the case for
> that becomes compelling.
>
> Again, my original point on this mailing list was just that there is a
> cost to adding more and more to the same headers with every version of the
> standard. I provided this benchmarking data because I was asked and I am
> also interested in experimenting with the latest C++ features.
>
> I still feel strongly about having instantaneous build times, but not
> everyone has to agree. Just for comparison my non-allocating stripped down
> version of the standard loads as a module and creates a simple object
> output in 16ms instead of 50ms. And that module has twice as much
> functionality as I would ever use.
>
>
But less than half as much I and others would use :-) e.g. your hxarray is
not exception-safe, has no emplace_back, has no integration with ranges
(insert_range, assign_range etc.), and so on. Of course you can make
something that compiles faster if you just design something for your
specific needs. That shouldn't be surprising to anybody.

Yes, all those features in std::vector and the rest of the library have a
cost, but IMHO they're worth waiting for 50ms instead of 16ms.

Received on 2026-05-26 21:58:04