This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to use hash tables for template specialization lookup
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 05 Jul 2009 23:28:31 +0200
- Subject: Re: C++ PATCH to use hash tables for template specialization lookup
- References: <4A4CEE11.5040604@redhat.com>
Hi,
> Someone recently sent me an expression template testcase, complaining
> about how slow compilation was; looking at it with callgrind, I saw
> that fully 64% of compilation was spent in retrieve_specialization,
> walking lists of specializations and comparing all the arguments. So
> I set out to switch GCC over to use hash tables for template lookup.
>
> The good news: the patch significantly reduces compile time (~25%) for
> that example.
>
> The mediocre news: the patch doesn't significantly affect compile time
> for the regression testsuite; testrun time is about the same before
> and after the patch.
I'm wondering if the benchmarks in Appendix C of "C++ Template
Metaprogramming" would be sensitive to such change... If you already
know the answer please stop me as soon as possible, otherwise, I'll
probably do some measurements over the next days...
Paolo.