C# build speed vs native C++
Is there anyone that have made any comparison between build times for similar sized C++ and C# projects ?
We are trying to convince our IT drone that a multi-million line C++ projects with heavy template usages, complies slower than a similar sized C# project and the extra money spent on memory and SSD disks are well spen开发者_高级运维t.
We are trying to convince our IT drone that a multi-million line C++ projects with heavy template usages, complies slower than a similar sized C# project and the extra money spent on memory and SSD disks are well spent.
That's for sure a common and really important problem of C++. I think it's the most urgent to fix in the next version of C++, mybe using Modules. It's a language design problem, linked to the way c++ compilation unit are organized.
Anyway, there are efforts to fix that by making compilers fasters. The most important effort currently is CLang.
For sources about the compilation time, there are tons (google : unity build, c++ compilation time)
But I think a demonstration would be better. Take boost (http://boost.org), compile it. It's a big set of libraries so it can easily compare with a big code source base in C#.
About using ssd to boost c++ compilation, here is a study : http://exdream.com/Blog/post/2009/05/03/Visual-Studio-compile-times-on-different-disk-drives-and-SSDs.aspx
But i belive, unless you use Ngen.exe on your project all the C# projects are 2 stage compilation process which we already know. But on C++, its one step compilation (No JITing). I guess there is a bit of difference in build times.Perhaps Jon Skeet should have a perfect answer.
I never did a comparison like this on similar projects, where similar you probably mean the same row count. But what I usually noticed on my experience, is that C++ compiles much slower. I suppose cause it passes more steps during compilation, one of with linking which can be pretty slow.
精彩评论