This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH: PR 20599 (1/3)


On 9/13/06, Douglas Gregor <doug.gregor@gmail.com> wrote:
Several of the facilities in the C++ Library TR1 just can't be
implemented well without variadic templates. Our current
implementation uses some disgusting, barely-maintainable preprocessor
metaprogramming to give a poor approximation of these libraries.
Variadic templates will help us improve compile times, simplify the
code, and provide a more flexible TR1 implementation than any other
compiler can.

More motivation for variadic templates is attached. This chart shows the compilation times for a simple program that includes all of the function objects and tuples parts of libstdc++'s TR1. We vary the maximum number of supported arguments from 3 to 40 (libstdc++ currently supports a maximum of 10), using evil preprocessor tricks.

I meant to go up to 100 arguments supported, but I run out of memory
on my Mac (that has 3.5MB RAM).

I do not have the complete variadic templates implementation to
compare against, but it should be faster than the 3-argument version
(under 1 second).

 Cheers,
 Doug

Attachment: ct_performance.png
Description: PNG image


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]