C++ Logo


Advanced search

Re: [std-proposals] Array Index in Range-based For Loops

From: Andrey Semashev <andrey.semashev_at_[hidden]>
Date: Fri, 3 Mar 2023 21:08:41 +0300
On 3/3/23 19:52, Jason McKesson via Std-Proposals wrote:
> On Fri, Mar 3, 2023 at 4:53 AM Andrey Semashev via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>> or if `import std` is more expensive than `#include <cstddef>` (or pick any
>> other lightweight header)
> We already have an answer to this. There's evidence, from the compiler
> that supports a standard library import, that it is close to an order
> of magnitude faster to `import std;` than to include even one header.
> The evidence is listed in P2412.

While this is better than nothing (thanks for sharing the reference to
the proposal), this is just one implementation on a platform that is
infamous for its slow filesystem. Given the history with precompiled
headers, which offered a significant speedup with MSVC on Windows and
nearly no benefit on other platforms, I'll keep my reservations until I
see numbers on other platforms and implementations.

> I know there are a lot of questions about modules out there. But
> people keep reraising these questions as if there aren't already
> answers to at least some of them.

I would say, that's because finding this kind of information is
virtually impossible unless you follow closely the particular proposals
or on the discussions on the MLs and reflectors.

Received on 2023-03-03 18:08:56