Huge compilation time of template based sources (AIX 5.2, VA C++ 6 compiler)

V

vitalyt

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
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
int
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
internal_value;
 
V

Victor Bazarov

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

[..nested templates..]

Have you tried contacting their Technical Support?

V
 
F

Fei Liu

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
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
std::pair
<
int,
int
internal_value;

what do you use this ugly beast for?
 
B

Bill Baka

Fei said:
what do you use this ugly beast for?
Too bad you can't compile on a DOS machine with huge ram drives. I have
tried things, not quite this big, but the old stuff sure beats the new
Windows junk. Even Linuxis getting a lot of bloat. I miss the good old
days but not the slow computers with only 16 MB of memory.
Bill Baka
 
J

Jeff Flinn

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
< ....
internal_value;

You might swith to boost::tuple or std::tri::tuple for such a beast, or even
look at boost::mpl for alternatives that have been architected with compile
efficiency in mind.

Jeff Flinn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top