For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > April 2006 > Re: Huge compilation time of template based sources (AIX 5.2, VA









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Huge compilation time of template based sources (AIX 5.2, VA
Logan Shaw

2006-04-18, 10:01 pm

vitalyt@gmail.com wrote:
> Hi,
> I have cpp file which consist nested templates. Compilation time
> without optimization is 1-2 minutes, with -O2 turned on more then 5
> hours. :( Could anybody help with that problem?
> AIX 5.2, Visual Age C++ 6 compiler
>
> #include <pair>
> using namespace std;
> // value
> typedef
> std::pair
> <
> int,
> std::pair
> <
> int,
> std::pair
> <
> int,
> std::pair
> <


I have a hunch that the compiler tries all possible permutations of
some optimization related to nested templates, so that the running
time is an exponential function of the level of nesting of the
templates. I would try removing one level of nesting and see if it
takes about half as long. Or remove two levels and see if it takes
1/4 as long.

- Logan
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com