Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Russell

GCC > MSVC 6 ?

This topic is 5398 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Everyone always says how gcc is slower than the MS or Intel compilers. I assumed that even MSVC 6 would be better than the newest gcc, but it appears that assumption might have been wrong. I benchmarked my chess program using both, and gcc was a hair faster (about 1%). I used -O2 for gcc. Anyone else have a similar experience? Or is this one test a fluke?

Share this post


Link to post
Share on other sites
Advertisement
It really depends on your programming style, and a myriad of other factors. In general, MSVC++''s optimizing compiler (available on the Pro and Enterprise versions of MSVC++) is faster than gcc, at least in Release mode.

You mentioned using -O2 for gcc--what settings did you use for MSVC 6?


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
I tried quite a few. The default release settings, and just about every combination of customized optimization settings that are available.

BTW, how does it depend on one''s programming style?

Share this post


Link to post
Share on other sites
If you need mostly integer optimizations, GCC (3.x) is extremely good at performing them (I don''t know about the newest release of Intel''s C Compiler, but GCC used to out-optimize 6.0 in a lot of hashing algorithms and such). Floating point optimizations still need some work for IA-32 as far as I''m aware, so other optimizers may handle them better. GCC is as good as any compiler at simple optimizations (function inlining, loop unrolling, all of that).

Since you mentioned a chess program, it leads me to believe that you''d be needing light integer optimizations and various generic optimizations, which GCC handled just fine.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
GCC rocks!!
Seriously I''ve been using it for some time and it only seems to get better.. MicroSoft is too busy with .NET, longhorn, and other things which is why I very much doubt they care about optimizing your C/C++ code now or making the compiler any better.. They know you''ll use it even if it''s slower, because it''s made by MicroSoft..
if anything they''ll purposely make it suck worse, so you''ll feel the need to use .NET
Isn''t the new MSVC(7) all about .NET? I wonder why?
Another conspiracy to add to the list?

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Another conspiracy to add to the list?

Yes. Anonymous Posters are actually "stupid bombs" sent from Mars to infect us all with stupid.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
GCC rocks!!
Seriously I''ve been using it for some time and it only seems to get better.. MicroSoft is too busy with .NET, longhorn, and other things which is why I very much doubt they care about optimizing your C/C++ code now or making the compiler any better.. They know you''ll use it even if it''s slower, because it''s made by MicroSoft..
if anything they''ll purposely make it suck worse, so you''ll feel the need to use .NET
Isn''t the new MSVC(7) all about .NET? I wonder why?
Another conspiracy to add to the list?

Regardless of how many other things Microsoft is juggling at once, I don''t think any really affects the others. They have a compiler group, and they just work on the compiler. If they decide to embark on something new like web search engines or new versions of Windows, then (suprise!) the compiler group keeps right on working on the compiler.

Regarding my program, yes, it''s pretty much all integer operations. I think I cast a few things to float so they look nice and pretty when displayed

Share this post


Link to post
Share on other sites
Which version of gcc? 3.2+ is pretty good at optimizations, even 2.95 wasn''t bad. You have to have the professional version of MSVC (or better) to get optimized builds.

Share this post


Link to post
Share on other sites
I''m not sure which version of gcc. I''ll check when I get home (at work at the moment). It''s whatever came with cygwin when I downloaded it a couple months ago (I think). And it was MSVC 6 pro.

Share this post


Link to post
Share on other sites
Actually my engine is a little faster when compiled with GCC 3.3 than with MSVC++ 2003 (release mode). Not very much, perhaps 1 or 2%, but still. And it's mostly floating point. I guess it really depends on the specific piece of code, but GCC is definitely not bad.

Edit: Ah no, correction: it was GCC 3.2 under Windows.


[edited by - Yann L on October 9, 2003 8:47:22 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!