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 12 5911
baibaichen wrote: 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
Link time is so minimal compared to compile time and totally negligible
compared to run time.
Design instead for maintainability . pImpl provides support for this, by
divorcing implementation and interface. The compile time benefits (if
any) are just icing on the cake.
baibaichen wrote: 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
The best advice I can give is do not create cyclic dependencies in your
modules.
Hope this helps,
-shez-
"baibaichen " <ba********@gma il.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. . 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
This is a bit platform dependent. But you could use dll/shared libraries to
a greater extent
so linking of the "executable " can be minimized to just the externals
provided by the libraries.
I've not noticed a problem with links on Windows or Red Hat Linux, maybe if
you use HP or
IBM you might have some long link jobs.
Perhaps you could use static functions where appropriate, but I suspect this
like trying to lose
weight by cutting your fingernails.
dave
"red floyd" <no*****@here.d ude> wrote in message
news:%0******** ***********@new ssvr25.news.pro digy.net... baibaichen wrote: 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
Link time is so minimal compared to compile time and totally negligible compared to run time.
<OT>
I've found that this depends upon the project. I've
worked on projects which used several large third-party
libraries. Link time was considerably longer than
compile time. This ratio was made even larger because
I often would suppy the compiler with several source files
at a time, which meant the compiler was only invoked once.
As always, YMMV.
</OT>
-Mike
red floyd wrote: baibaichen wrote: 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
Link time is so minimal compared to compile time and totally negligible compared to run time.
Design instead for maintainability . pImpl provides support for this, by divorcing implementation and interface. The compile time benefits (if any) are just icing on the cake.
I have a different view on that. I hate writing code for an hour and then
searching for the erros for several hours because I did so many changes at
once. So I usually rather change my code in many small steps.
Each time, I have to compile the program to try whether it's ok. If compile
time is long, it slows me down considerably.
baibaichen wrote: any reference or any idea is appreciated
In general, reducing the dependencies between modules improves both
compile and link time, sometimes removing the need to compile and/or
link certain parts of the application altogether (the latter is the
case when using shared libraries/DLLs where only this objects needs
to be linked). The pimpl idiom is just one approach to reduce
dependencies, there are several others. John Lakos' "Large Scale C++"
(Addison-Wesley) presents several decoupling techniques.
--
<mailto:di***** ******@yahoo.co m> <http://www.dietmar-kuehl.de/>
<http://www.eai-systems.com> - Efficient Artificial Intelligence
On Tue, 10 Jan 2006 13:38:03 +0100, Rolf Magnus <ra******@t-online.de>
wrote: I have a different view on that. I hate writing code for an hour and then searching for the erros for several hours because I did so many changes at once. So I usually rather change my code in many small steps. Each time, I have to compile the program to try whether it's ok. If compile time is long, it slows me down considerably.
This follows the Refactoring Methodologies outlined in Martin Fowlers
book. Hey, they have a webpage: http://www.refactoring.com/
Good Stuff.
baibaichen wrote: 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
if you are using the GNU toolchain, you might take an alternative
compiler/linker combination into consideration. The GNU linker is known
to be slooooooow...
Tom
Rolf Magnus wrote: red floyd wrote:Design instead for maintainability . pImpl provides support for this, by divorcing implementation and interface. The compile time benefits (if any) are just icing on the cake.
I have a different view on that. I hate writing code for an hour and then searching for the erros for several hours because I did so many changes at once. So I usually rather change my code in many small steps. Each time, I have to compile the program to try whether it's ok. If compile time is long, it slows me down considerably.
And two years down the line, when you have to spend three days searching
for the bug your clever link optimization caused, or you're dealing with
a portability issue (you need to port to a different OS) caused by your
clever link optimization, you'll have wasted much more time.
Not to mention that to fix said bug, you'll probably have to refactor
etc... Design for mainainability. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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?
|
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>
|
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;
|
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)
|
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.
| |
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
|
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?
|
by: jbanik10 |
last post by:
. What errors are caught at compile time vs link time?
|
by: Akino877 |
last post by:
Hi,
I am trying to compile the following program :
#include <stdio.h>
#include <time.h>
int main( )
{
char dateStr ;
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |