473,394 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

tricks to organize code for faster compile

Dear all,
what do you people use for organising code for optimal compile time?
I have an app , gui + core + file ops, which is growing and compile time is
too long, need a better way of organising the code. Could someone please
highlight what could be done to speed up compile time, tia.
Greger
--
http://www.gregerhaga.net
Aug 13 '05 #1
4 2222
Greger wrote:
what do you people use for organising code for optimal compile time?
The simplest "trick" I use is forward-declaring all that can be instead
of defining.
I have an app , gui + core + file ops, which is growing and compile
time is too long, need a better way of organising the code. Could
someone please highlight what could be done to speed up compile time,
tia.


Splitting your code into components and building them separately should
also help. See John Lakos' "Large-Scale C++ Software Design" for more
information on separating your code into components.

V
Aug 13 '05 #2
Greger wrote:
Dear all,
what do you people use for organising code for optimal compile time?
I have an app , gui + core + file ops, which is growing and compile time is
too long, need a better way of organising the code. Could someone please
highlight what could be done to speed up compile time, tia.
Greger


U++ (upp.sf.net) provides build technology (blitz-build) that in most
cases reduces build time 4-8 times.

It works by grouping .cpp files together and compiling them as single
unit. This way included files are processed just once. As C++ compiler
spends most time parsing headers (usually it is hunderds of thousands .h
lines and thousands of .cpp lines), compile time reductions are really
dramatic.

Of course, it needs more magic to work than can be explained in a single
post :)

Mirek
Aug 13 '05 #3
On Sat, 13 Aug 2005 12:36:24 +0200, Greger
<bo*******@marketweighton.com> wrote:
Dear all,
what do you people use for organising code for optimal compile time?
I have an app , gui + core + file ops, which is growing and compile time is
too long, need a better way of organising the code. Could someone please
highlight what could be done to speed up compile time, tia.
Greger


What Victor and Mirek said, but also use precompiled headers if you
can.

--
Bob Hairgrove
No**********@Home.com
Aug 14 '05 #4
"Greger" <bo*******@marketweighton.com> wrote in message
news:dd**********@phys-news1.kolumbus.fi...
Dear all,
what do you people use for organising code for optimal compile time?
I have an app , gui + core + file ops, which is growing and compile time is too long, need a better way of organising the code. Could someone please highlight what could be done to speed up compile time, tia.


Avoid networked drives, especially for intermediate files.

--
Regards,

Joe Hotchkiss,
http://joe.hotchkiss.com
http://harrowsubaqua.org.uk

XXXXXXXXXXXXXXXXXXXXXXXXX
X joe.hotchkiss X
X at selex-sas.com X
XXXXXXXXXXXXXXXXXXXXXXXXX

Aug 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Shailesh Humbad | last post by:
I just posted an article I wrote called ASP Speed Tricks. It covers techniques to optimize output of database data in HTML, for both simple tables and complex tables. More advanced ASP authors...
822
by: Turamnvia Suouriviaskimatta | last post by:
I 'm following various posting in "comp.lang.ada, comp.lang.c++ , comp.realtime, comp.software-eng" groups regarding selection of a programming language of C, C++ or Ada for safety critical...
2
by: key9 | last post by:
Hi all on last post I confused on how to organize file of class, ok ,the problem solved : should include class define head on cpp file. but this time ,still link error: strange is I put the...
12
by: Jchick | last post by:
Boy, this should be a simple bit of code but I can't figure out how to make it happen. I have a CSV file shows up in a directory that has 4 fields that need to be printed on labels. Each line of...
2
by: key9 | last post by:
Hi all look at the organize tree main.c ------ #include lib_adapter.c main() { foo();
28
by: sowmiyakc18 | last post by:
Please clear my doubt. When do we declare a variable to be a register variable? What is its significance? What are the conditions to be adhered to when register variables are passed between...
0
by: Medhatithi | last post by:
Hi, I have been in several ways benefiited from this site. I would like to share some sql tuning techniques(simple, but effective) with you all. SQL Tuning Tips Oracle Tips Session #6 ...
68
bartonc
by: bartonc | last post by:
I've decide to compile a bunch of your favorite tips and tricks for the Articles section. I found a post yesterday by Chrisjc that is a perfect example. I copied his post over to create Dealing with...
1
by: JosAH | last post by:
Greetings, Introduction This week's tip describes a few old tricks that are almost forgotten by most people around here. Sometimes there's no need for these tricks anymore because processors...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.