Solved

How to increase link speed for a large c++ dll in VS 2005?

Posted on 2010-11-11
5
737 Views
Last Modified: 2012-05-10
I have to support a quite large C++ application (win dll). I use MS Visual Studio 2005 as IDE.

The app is structured (under VS 2005) as a solution with 7 o 8 projects and about 400 files (200 .h or .hpp and 200 .cpp).

A full rebuild in release mode takes around 5 minutes to compile and 15 minutes to link (in an Intel Core2 Duo PC with 2GB RAM).

So reducing linking time is desirable.  Are there any tips for improving the link time?

Even more annoying is that the same slowness happens in debug mode (also in link time).

The size of the release dll is around 11 MB (20 MB debug dll).

All this slow linking started to happen when I upgraded VS from 2003 to 2005. With VC++ 2003, a full release rebuild use to take less than 10 minutes.

I am using precompiled headers (pch). Most of the code is written as c++ templates.

Most of the projects compile to static libraries. It seems the use of static libraries prevents VS2005 from using incremental linking, so even with incremental linking turned on it does a full link every time.

Any idea to reduce linking time?
0
Comment
Question by:JorgeMarreroMorejon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 8

Expert Comment

by:JIEXA
ID: 34118047
1. Templates are extremely complicated at linkage time. If you can use non-templated code, this will reduce linkage time.
2. Get procmon from sysinternals.com. At the linkage time trace what files are open/read/written. This may give you some clues.
0
 
LVL 5

Expert Comment

by:greatsubash
ID: 34118185
0
 
LVL 8

Accepted Solution

by:
JIEXA earned 500 total points
ID: 34118250
In addition to my comment: if you see a big activity to some files in procmon, you can put them to RAM-drive (in case you have a lot of memory, 64-bit OS) or to SSD disk (if you have one or can buy).
0
 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 34120860
Can you down grade back to VS2003 or upgrade your computer?

I know that seems like sort of a silly response, but I'm not suprized that a Microsoft UPGRADE results in a DOWNGRADE in performance.  From what I've seen, MS is all about features, and lets advancements in hardware take care of "performance issues".  (Haven't you heard the phrase "What Intel Giveth, Microsoft Taketh?).

But seriously, unless there is something you NEED out of VS2005, if the upgrade is what killed your perfomance, then downgrade back until you can upgrade both the hardware and the software is my suggestion.
0
 

Author Closing Comment

by:JorgeMarreroMorejon
ID: 34141585
The clue to improve performance has been to check the IO activity. It seems the corporative antivirus is slowing down the writing of temporary files generated both by cl.exe and link.exe. I managed myself to disable the AV and now the full release is taking 15 minutes to build. That is, half time less than before.
Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to split this in C++ 4 127
trigs fail! I thought I knew how to do trignometry 3 93
No module found pypyodbc, 3 55
maximize the sum of fractions 33 74
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question