Re: [scheme-reports-wg2] Threads and futures
Ray Dillinger 01 Apr 2022 23:27 UTC
On 4/1/22 23:20, Per Bothner wrote:
>
> From my days as a young gcc hacker, I'm pretty sure gcc does
> this optimization automatically. Or at least it used to.
> Other quality compilers probably also do so.
Coding the 'optimization' correctly though is problematic because
you don't know what you don't know about the header and how it's going
to interact with other header variables that have been set since the
most recent time it was parsed. It's easy if we assume that headers are
idempotent. But in conforming C/C++ they are not idempotent unless the
contents make them so.
But whether it ought to be easy or hard, if profiling shows that most of
your time is spent parsing headers, this is what to do.
Bear