Debug builds compile much more slowly than release
build, c++, visual-studio
Solution
I'm going to put starbolin's comment down here as the answer: apples and oranges. charley's guess of I/O limited did not seem to pan out with my Process Monitor calculation of 600MB written for debug and 300MB for release. That is, writing an extra 300MB would take a few seconds, not 4 minutes. Therefore I conclude there are likely just a bunch things different between Debug and Release builds. Although optimization should take longer than no optimization, these other debug-only activities must take more time than that. Would be nice to see a breakdown of exactly where the time goes for Debug and Release, but it seems clear they are quite different processes and Debug just takes a lot longer, at least for Visual Studio 2005 and the project I benchmarked.
Problem
Under Visual Studio 2005 we have a single library w/ 195 cpp files which takes about 2 minutes to build for release but about 6 minutes to build for debug. I always thought release builds should take longer because of optimization. Why would a debug build take so much longer than release? Is there anyway to speed our debug build up to be as fast as release? We do have a fair amount of boost/stl code.