10
votes

We have a large project, >1M lines of code in about 300 DLLs. So far we've been using VS6.

I've now converted everything to VS2008, all compiles, links and more importantly - runs!

==>However... the resulting compiled OBJ files are X 10 bigger and linking is extremely slow, with the linker hitting >1GB of memory quite often.

Part of the implications are that I need to compile certain prjects with /bigobj.

Result is a build that went from about 1:45 on a desktop to 3h. The DLLs and the LIBs are roughly the same size as in the old VS6 build.

I've read all I could find here but didn't find a remedy to this problem. If it is additional DEBUG info - I don't want it. I had enough before. The size in release increased, but not so much...

Anyone has any idea? Or is my only option to break down the projects into much smaller units? Is refactoring my only hope?! Surely there's a secret flag I missed...


Edit1 (13/07/2012 12:20BST) I've compared dumpbin of an Obj created by VS6 vs. VS2008. The one in 2008 appears as if "staticly linking". In VS6 it contains a few symbols all from the current DLL. In VS2008 it contains symbols from (probably) all libraries it is dependent upon. Dumpbin sizes are 66kb and 32,000kb for VS6 and VS2008, respectively.
1
Try disabling "debug information" in project settings (C++ branch).Ivan Shcherbakov
"We have a large project, >1M lines of code in about 300 DLLs. So far we've been using VS6." I'm never going to complain about my job again.Luke
@IvanShcherbakov - won't this prevent me from easily debugging?aabramovich
BTW satisfied Xoreax Incredibuild customer here. We've got a few big build servers here on site; over 90% of a build is offloaded to them.MSalters
@MSalters - we've tried incredibuild, and unfortunately we weren't satisfied. Initially it was my preferred approach. Plus, as linking is the biggest bottleneck - Incredibuild doesn't solve this.aabramovich

1 Answers

5
votes

Check your debugging options. /Z7 causes large .OBJ files, /Zi puts the same information in a separate .PDB file.

Compiler option /Oi may help by inlining intrinsic function, which then no longer need to be linked. You probably don't want to debug memset anyway.

Turn off /Gm (incremental rebuild) so you can turn on /MP (parallel build). Also turn off /Gy - while it makes for smaller EXE's, it causes bigger OBJ files and slower linking.