473,769 Members | 5,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to decrease link time

i know that pImpl idiom can decrease compile time, but Is there any
good practice/idiom to decrease link time?

any reference or any idea is appreciated

thanks

Jan 10 '06
12 5916
imagine that I am sitting at my desk fixing bugs all day long. When I
make a change and build, how many files are going to compile? 3? 10?
100? My guess is that over a whole day, each build will compile maybe
five files on average. Only rarely will I make a change to some header
file that causes more than 100 files to be recompiled. How long does it
take five files to compile? On my laptop, which is over a year old,
five files will compile in less than 30 seconds, and often in less than
10 seconds. Now consider link times: on my laptop, it takes about 12
minutes for DVDit to link, even if only one source file was changed.

Even if I were compiling 50 files, that's still less than five minutes,
and often less than two minutes. I wonder how much you could actually
reduce that by using relative paths.

Jan 11 '06 #11
* baibaichen:
i know that pImpl idiom can decrease compile time, but Is there any
good practice/idiom to decrease link time?


Yes, the same as in general programming: divide and conquer.

If you're linking some hundreds of object files you have packaging problem:
repackage in smaller libraries (this may require some redesign; packaging
can affect design and vice versa). Use the appropriate options and/or tools
to optimize your libraries for fast access. E.g., under *nix, run 'ranlib'.

If you're linking some hundreds of libraries you also have a packaging
problem: repackage in smaller executables and dynamic libraries (this may
require some redesign; packaging can affect design and vice versa).

Of course this has only tangentially to do with current C++ as a language.

But, to the degree usage of the language is affected and hindered by tool
usage I think at least this kind of high level advice is on-topic. However,
be aware that concrete tool usage issues are rarely or not ever on-topic in
this group. This group is concerned with the C++ _language_.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jan 11 '06 #12
Are you using libraries (shared?) or do you just link all object files?
Just a wild guess: I suspect the system starts trashing when you link.
Monitor the disk I/O, memory and swap space usage.

regards, Stephan

Jan 11 '06 #13

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

Similar topics

1
1548
by: john smith | last post by:
Hi, I have a quesion about how to deal with multiple symbols at link time. I have a function name that must be a certain name and it is the same name as in a custom library that I use. I want to use my function and not the function in the custom library. So how do I make sure that the linker will only see my function name and not the other library one hence taking care of the multiple symbol name?
0
2792
by: mrambil | last post by:
Hi, I've got some problems using ODBC with C++. First, I use Dev-cpp with gcc/g++ v3.4.2 on Win XP. I got to connect to a system DSN installed on my computer so I use the standard SQL API provided with my compiler. Here is a code snippet from my sources : #include <windows.h> #include <iostream>
1
352
by: nzanella | last post by:
Hello, I have two .cpp files. The first one contains: Foo *foo; and in the second one contains: Foo foo;
3
10246
by: mike | last post by:
trying the following code to test SQL connection to MS SQL server using machine DNS name. receiving errors: undefined reference to 'SQLAllocEnv@4' undefined reference to 'SQLAllocConnect@8' (etc. for all SQL function calls in the code) using Dev-C++ 4.9.9.2 and the latest mingw WindowsAPI package (where the sql header files are)
1
1334
by: AP | last post by:
Hi, Does anyone have suggestions (maybe options etc) as to how I could improve my compile and link time in VC7.1. I'm seeing a pretty bad deterioration from VC6. BTW, I use pre-compiled headers. Thanks in advance. AP.
2
1461
by: Chris Stankevitz | last post by:
My very large native C++ app takes a long time to link (approaching five minutes). How can I troubleshoot *why* it takes so long to link? I'd like to look for ways to reorganize things to speed up the link. Thanks, Chris
5
3194
by: Ed | last post by:
Hello, dear all, In the VS2005, Project Release Configuration, the default option of "General | Whole Program Optimization" is "Use Link Time Code Generation". I find when use this option, the size of the objects and output is vary large. The object use this option, which size is 10 times of the one w/o it. Is this normal?
2
2060
by: jbanik10 | last post by:
. What errors are caught at compile time vs link time?
1
5298
by: Akino877 | last post by:
Hi, I am trying to compile the following program : #include <stdio.h> #include <time.h> int main( ) { char dateStr ;
0
9583
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10210
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10039
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9860
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6668
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.