https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60976

Giuseppe Ottaviano <ott at fb dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ott at fb dot com

--- Comment #19 from Giuseppe Ottaviano <ott at fb dot com> ---
At Facebook we experienced a similar regression, compilation times more than
doubled for several large C++ files.
We found that the regression was mostly caused by r207240, specifically to the
changes in bits/alloc_traits.h. Just reverting that file brought back build
times almost to previous levels.

By looking at GCC profiles, a disproportionate amount of time is spent in
structural_comptypes and template_args_equal (which doesn't happen before the
change). The revision only changes the way some traits are selected through
SFINAE, specifically the pattern:

template <typename T> enable_if<..., R>::type f();

became

template <typename T, typename = _Require<...>> R f();

and _Require is just a wrapper around enable_if.

I don't know why this change has such a large impact on compilation times, it
would deserve some investigation. Other parts of the standard library might be
affected by this.

The regression might have been already solved in r225244, which uses yet
another SFINAE pattern without extra template arguments, which I believe are
the cause of the regression. However I haven't tested it yet.

Reply via email to