VS2008 compiler 3 to 4 times slower than VC6.0 - by Andy Kilpatrick

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 547569 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 4/1/2010 5:41:54 PM
Access Restriction Public


I am attempting to port an large (>1 million LOC, 1000s of .c +.h files) build from Visual C++ 6.0 to VS2008.  C code.
Main problem hit is that compile time (with identical hardware and code) has gone from just over 1 hour to ~ 4hours.  
It is cl.exe CPU use which is the issue here - with cl using 100% CPU during the builds in both cases.

Some details:
- Build is command-line - I've switched from "msdev foo.dsp" to "vcbuild foo.vcproj".  This is not a GUI issue.
- trying out various VS2008 optimization settings, debug options, etc did not help
- no precompiled headers (before or after port).  Given large codebase size (+ it is also built on UNIX) so this is not an option.
- tested on WinXP (single processor) + Windows 7 (single processor) machines - same result.
- no MFC / .NET code here - just C console apps.

I understand that the VS2008 compiler is likely to be cleverer (better C/C++ standards support, better runtime / buffer overflow checking, so does more work).  But is a factor of 3 or 4 slowdown really to be expected?  Is this likely to change (significantly) in VS2010?  Am I just going to have to throw hardware at the problem?  

Note I will not be able to provide my source code.  But I have reproduced this by running "cl /Od /c *.c" on 500 identical small C files (code below - I made copies as test1.c...test500.c).  Typically took 4-5 seconds with VS6.0; ~20seconds with VS2008. 

sample file:
/* Some C code to compile                                                    */
#include <stdio.h>

int internal()
  int x;
  int y;

  printf("Some code\n");

  for (x = 0; x < 100; x++)
    y = 100 - y;

Sign in to post a comment.
Posted by Microsoft on 4/2/2010 at 2:16 PM
Hello Andy,

We appreciate your feedback. Your observation is correct, VC 2008 compiler may indeed feel slower compare to VC6.0. Since the 6.0 compiler supports many more features and optimizations. Headers files have also greatly increased in size.

Ulzii Luvsanbat
Windows C++ Team
Posted by Microsoft on 4/1/2010 at 11:17 PM
Thank you for your feedback, We are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)