Abnormal C++ Compile Time - How to debug?

M

mieskola

I have a project which contains numerous regular and test C++ files.
One test file in particular takes a ridiculously long time to compile
(about 3-5 minutes), whereas the rest of them take 3-4 seconds.

Is there a way to figure out what in this file is taking so long to
compile? Can I compile under gdb or dbx to find something?

Thanks!

AJ
 
V

Victor Bazarov

mieskola said:
I have a project which contains numerous regular and test C++ files.
One test file in particular takes a ridiculously long time to compile
(about 3-5 minutes), whereas the rest of them take 3-4 seconds.

Is there a way to figure out what in this file is taking so long to
compile? Can I compile under gdb or dbx to find something?

Most likely that file has either abnormally large number of inclusions
or some of those included files are on a slow medium (like network).
Another possibility is that compiling that file takes long because there
are unusually many (compared to other files in your project) templates
generated... Hard to say. Try posting to the newsgroup that deals with
your compiler.

V
 
I

Ian Collins

mieskola said:
I have a project which contains numerous regular and test C++ files.
One test file in particular takes a ridiculously long time to compile
(about 3-5 minutes), whereas the rest of them take 3-4 seconds.

Is there a way to figure out what in this file is taking so long to
compile? Can I compile under gdb or dbx to find something?
Break the file down and find which bit takes a long time.
 
B

Ben Pope

mieskola said:
I have a project which contains numerous regular and test C++ files.
One test file in particular takes a ridiculously long time to compile
(about 3-5 minutes), whereas the rest of them take 3-4 seconds.

Is there a way to figure out what in this file is taking so long to
compile?

Inspection, usually.

Ben Pope
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top