C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: extremely long compile time with large number of string literals
From: Mandeep Sandhu (mandeepsandhu.chd_at_[hidden])
Date: 2020-07-09 19:44:37


>
> std::string can throw. For the Nth string that can throw, the compiler needs
> to generate code to destroy all the N-1 strings that were created before that
> point, then resume the exception unwinding. Experimenting with GCC shows me
> that, fortunately, the compiler generates a loop if you're using
> std::initializer_list, so this is likely not the reason you're experiencing
> long build times.

Could it be overload resolution (where the compiler has to figure out
which constructor to call) takes up much of the time?

Running with -ftime-report showed 89% of the time was spent in "phase
opt and generate". Im not sure what all compilation stages this
encompases.

-mandeep

>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Software Architect - Intel System Software Products
>
>
>


STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups