5 ms·
> The classic example is GCC which has probably 10x > more people working on it than any commercial > compiler, yet the Intel and MS C/C++ compilers > gen
by gcr 16y ago
> The classic example is GCC which has probably 10x
> more people working on it than any commercial
> compiler, yet the Intel and MS C/C++ compilers
> generally kill it.
Oh? Interesting; I thought that gcc was one of the better ones. Could you elaborate?
- kenjackson 16y agoGCC has generally had perf numbers that lag the commercial compilers. Although GCC has narrowed this gap recently as C/C++ has generally fallen out of favor by the major vendors (and commercial vendors aren't working much on raw C/C++ performance anymore).
- icefox 16y agoEven when I run them on my amd cpu?
- kenjackson 16y agoTo answer your question, probably not. icc has a long history of being less good on AMD processors, and almost certainly not on accident. With that said, they don't have a monopoly on x86 compilers. Microsoft's Visual C++ has been about equally good on both platforms and is far more dominant. But with that said, I'm sure you know, that's not really relevant to the discussion at hand :-)
- rbanffy 16y agoSo, the Intel's compiler trounces GCC when the code it emits run on certain x86 processors. And Microsoft's compiler does a much better job when the target runs on Windows on x86 processors. If we narrow the target enough, all comparisons become interesting. I am quite sure GCC will blow both Intel's and Microsoft's compilers out of the water when it comes to compile code for IBM mainframes. I am sure it's much better than Intel's when it comes to target my phone's ARM processor.
- kenjackson 16y agoAnd my blender makes better smoothies than GCC. So your point is that GCC is better at things that other tools aren't attempting at all? OK, good point.
- rbanffy 16y agoYour point was that GCC was not as good at specific things that are the sole focus of the products you mention. Intel's compiler only targets Intel's x86s and Microsoft's compiler only targets the (two or three) OSs Microsoft makes. It's not really an apples to apples comparison. For me the Intel compiler makes sense in certain specific applications (many of my servers are not even x86), but the Microsoft compiler is absolutely worthless.
- kenjackson 16y agoMy point was that GCC is not good at specific things that customers care about (and it is good at other things, but I'd argue these things are more niche, such as retargeting for custom embedded devices). For example, code size, throughput, debugging, and optimization are all places that the Visual C++ compiler is superior than GCC. How many Windows games are written with GCC? How many top-tier Windows apps are written with GCC? If I'm writing a Windows C/C++ application, I'm going to either use Visual C++ or icc. I'll choose icc for code with lots of compute intensive loops or vectorization opportunity. VC is better when icache is an overriding concern. Now that may not be what you do, but to say, "Who in their right mind writes programs for Windows?", I think says more about you than it does about the respective compilers.
- rbanffy 16y agoFrom my point of view, Windows desktop software is a niche. It's a good, big and profitable one, but one I do not take part in. I agree Visual C++ is a great compiler for that specific target. Still, there is a lot more to programming than desktop applications that run on x86 processors under Windows. And embedded ARM processors outnumber desktop x86s by a large margin. I carry at least three of them with me at all times.
- psadauskas 16y agoI think thats because GCC will compile anything anywhere. MS is only Windows platform, and ICC prefers Intel x86 CPUs. Since the other compilers didn't stand a chance to compete with GCC on portability, the only other thing they could compete with it on was performance. Since they focused on it, they should clearly be more performant in their niche.
- kenjackson 16y agoSince the other compilers didn't stand a chance to compete with GCC on portability, the only other thing they could compete with it on was performance. Since they focused on it, they should clearly be more performant in their niche. I think your skewed world view is apparent here. MS and Intel certainly didn't come and say, "One of our top priorities is portability. How can we target our compilers to platforms that we have nothing to do with? Oh wait, GCC already does that!" Of course not. Honestly, GCC has been an afterthought for most of the history of C/C++. It's only now that it is effectively dead that GCC has started to become competitive. MS was focused on Borland for years (and it actually didn't generally revolve around perf, but generally build throughput). Likewise, Intel was focused on SPEC against xlc and other architecture specific compilers. And as I said in another post, they (GCC, Intel, MS) have different priorities. If your goal is to have a somewhat portable C/C++ compiler then GCC is the way to go. If you want the best perf/throughput on a specific target then MS and Intel are your best choice.
- wladimir 16y agoOn which benchmarks? Is this the case for both x86 and x86/64 targets? Do you have any specific reference?
- Locke1689 16y agoOn pretty much all benchmarks -- just Google scholar search. We used GCC but only because it's portable. Performance wise on IA-32(e) GCC is {EDIT:Language} not as good.