Archived

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

KingPin

Fastest compiler? Best IDE?

Recommended Posts

KingPin    122
this post made me rethink supporting MSVC. I''ve been using MSVC 6.0 Intro for some time now (got if from TOTWGPG book) and just got used to the IDE. Is there a better IDE than MSVC''s? And which compiler produces the fastest C++ code? MSVC Pro, Intel C++ Pro???? Thanx in advance. "1-2GB of virtual memory, that''s way more than i''ll ever need!" - Bill Gates "The Arcade: Quite possibly the game of the century!" - The Gaming Community may or may not represent anybody in paticular

Share this post


Link to post
Share on other sites
NuffSaid    122
I think the compiler that generates the fastest code is the Intel C++ compiler or VectorC. AFAIK, it works like a plugin for MSVC.

As for the IDE, it really is up to you. Personally, I like the MSVC IDE. I like it even more when I''ve got VisualAssist installed.

If you''re not on a budget, get the Pro version of MSVC. Otherwise, the Standard version will do fine.

Share this post


Link to post
Share on other sites
ATronic    122
Mmm.... CodeWarrior. Highly customizable in terms of generated machine code. I think it''s nice. But only if you get the professional edition. Otherwise you get a limited version of the compiler that is not nearly as efficient.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

Share this post


Link to post
Share on other sites
Null and Void    1088
CodeWarrior''s optimizer puts MSVC''s to shame . GCC is also way better than MSVC in a lot of cases (it is better than CodeWarrior sometimes, worse othertimes, it really depends). Intel''s compiler is pretty good, but as you would guess, you get the most out of it for Intel processors (it is still good for other company''s though). I haven''t tried VectorC though.

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
Null and Void    1088
quote:
Original post by Sly
If you want the fastest compiler then you have to ditch C and C++. Go for Delphi. Well before a C++ compiler even gets to the linking stage, a Delphi application is compiled, linked and running.


That''s not what he''s talking about, he''s talking about the fastest executable produced. Delphi is still lacking a lot of the features in a fully compliant C++ compiler, so comparing their compilation speeds is somewhat inadequite.

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
Array Master    122
I personally like Blitz Basic the best. It uses Basic syntax, and it''s made for games, but it'' very fast. I''m not sure if it''s the code or Blitz itself, but it uses a lot of assembly language, as well as C++ in other parts.

Are you sure you can''t optimize your code any better? That''s usually the best cure for slow run-time programs.

Share this post


Link to post
Share on other sites
Beer Hunter    712
quote:
Original post by Sly
If you want the fastest compiler then you have to ditch C and C++. Go for Delphi. Well before a C++ compiler even gets to the linking stage, a Delphi application is compiled, linked and running.


Borland c++ has a compiler about as fast as Delphi. I sincerely hope that compilation speed was not your only reason for using Delphi, but if it is, why aren''t you using pure assembly code?

When I''m testing my code to see how well it works, I use borland c++. I use gcc/mingw32 for my final compile, which is a lot more optimising.

Share this post


Link to post
Share on other sites
NuffSaid    122
I can''t seem to find the link to the site that showed the performance difference between Delphi and C++.

Lets see if anyone can remember it. Basically, there''s a challenge to write a program that does something (can''t remember exactly what), and you''re allowed to implement it in Visual C++ or Delphi. You send the binaries to the website maintainer and he benchmarks them.

Last I recall, Delphi led Visual C++ by a small margin (which really, really shocked me). Don''t know about now as I can''t find the site anymore.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
The link is "Jake''s Code Effiency Challenge", at http://home.xnet.com/~johnjac/

Delphi is the quickest at natively compiling code (i.e. compiler speed). The Borland C++ compiler is not nearly as quick, though still quite good. As this link shows, the entries are always neck and neck between VC++ and Delphi. There is really no performance difference, so get over it!

Alistair Keys

P.S. Studies show Java is more productive than C++. Why doesn''t the industry wake up and get rid of this pants language forever?

Share this post


Link to post
Share on other sites
NuffSaid    122
Because there are still some things that Java can''t do. Off the top of my head, and example of this is where run-time memory requirements are of a major concern, using Java isn''t going to be very prudent.

Distribution of a Java app is a major pain as well. I use the very latest JDK (ahem, Java 2 SDK ). The problem is ensuring that all end-users have the JRE that''s the same version as the one I''m using. To top it off, the size of the JRE isn''t exactly small either, which makes people put off downloading it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I agree entirely, NuffSaid. It''s just that once I start flaming C++, it''s hard to stop . I guess I''ve just had too many bad MFC (shudder) experiences. I''m using Java for my Honours project, so I know all about its foibles.


Alistair Keys

P.S. Prolog is the way to go

Share this post


Link to post
Share on other sites
Sly    128
quote:
Original post by Beer Hunter
Borland c++ has a compiler about as fast as Delphi. I sincerely hope that compilation speed was not your only reason for using Delphi, but if it is, why aren''t you using pure assembly code?



Borland C++ compiler is still way too slow for me. I use Delphi for all my personal projects because it is my opinion that it is a much nicer language to develop in. It may not have all the wiz-bang features of C++ (templates, multiple inheritance), but it has the ones that count and it''s easier to read and follow the source. The almost-zero build times are just a bonus.

I do fear that it was my original post that got this thread way off track because I didn''t read the question properly. That was always my problem in uni exams.

Steve ''Sly'' Williams  Monkey Wrangler  Krome Studios

Share this post


Link to post
Share on other sites
Null and Void    1088
quote:
Original post by Sly
It may not have all the wiz-bang features of C++ (templates, multiple inheritance), but it has the ones that count and it''s easier to read and follow the source.


I use those features, so I think they count . There''s no reason you shouldn''t use Delphi if you want to, I was just trying to point out how comparing their compilation speeds isn''t quite fair .

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
NuffSaid    122
I''m not sure I understand Delphi well, but there''s one thing about it that really stumps me.

Lets say I have a procedure that accepts and array of 10 integers. There''s no way I''m going to make it accept an array of 11 integers, because Delphi sees that as a different type. Now, how am I supposed to write a function that takes an array of any length?

procedure stuff(a : array[1..10] of integer);

to the Delphi compiler is different from

procedure stuff(a : array[1..11] of integer);

The only way I''ve managed to solve it is to make the parameter a pointer, very much like I do in C. Is there a better way to do it in Pascal?

Share this post


Link to post
Share on other sites
grasshopa55    128
It seems strange to me that KingPin asked about C and C++ compiliers and somehow Delphi got into the argument. If I remember correctly Delphi is Pascal, correct? If so, then Delphi doesn''t really matter. As for execution speed, unless you are planning on supporting older systems, 386, 486, etc, it may be a mute point. Computer hardware is so inexpensive these days, that you don''t need to be as stingy when it comes to CPU cycles. You could compile and link standard code with any number of compiliers and their execution speed difference will be minimal,ie: nothing you could ever notice unless you were timing nanoseconds.

What I mean by standard code, is code that does not make use of any special CPU instructions (ie MMX) or other special apis. I guess, as with most of these discussions, it leads to need. It really depends on what you are going for. Use what you like, or performs best in your situation.

-----------------------------
kevin@mayday-anime.com
http://games.mayday-anime.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
There was a post on Turbo that described a way to do template-like things using Interfaces in Delphi. I''ll dig up the link later (tomorrow, because it''s time for me bed), unless Sly beats me to it, but rest assured it''s possible. There was also an article explaining how to do multiple inheritance (or something simulating it, anyway) from The Delphi Magazine, but I lost the link. Besides, they expect you to subscribe for money, and I''m a cheap student .

If it helps: multiple inheritance smells of poo. Don''t use it, or you''ll get haunted by my ghost when I die (probably when Stoffal finds out where I live, lol :p).

NuffSaid: I think you can just say:

procedure Stuff(a: array of Integer);
begin
{ use High() to get upper bounds of a, zero-based }
end;

This should work for any array. It''s called Open Arrays, and is handled differently from Dynamic Arrays (which use exactly the same syntax, just out of a procedure).

I read that the Intel compiler is pretty good (on Alex Champandard''s site, he writes sometimes for FlipCode). He gives a couple of examples, but that isn''t reliable evidence. Heck, I don''t want to start a flaming session in this thread too .

Alistair Keys

Share this post


Link to post
Share on other sites
Sly    128
quote:
Original post by Anonymous Poster
There was a post on Turbo that described a way to do template-like things using Interfaces in Delphi. I''ll dig up the link later (tomorrow, because it''s time for me bed), unless Sly beats me to it, but rest assured it''s possible.

Yes I will beat you to it. Here''s the link
Templates in Object Pascal
Mind you, they are only simulating templates and they do not support all the features of C++ templates. They are also a bit messier to setup.
quote:
NuffSaid: I think you can just say:

procedure Stuff(a: array of Integer);
begin
{ use High() to get upper bounds of a, zero-based }
end;

This should work for any array. It''s called Open Arrays, and is handled differently from Dynamic Arrays (which use exactly the same syntax, just out of a procedure).

Use Low() for the lower bounds of the array instead of assuming it is zero. You could also pass a pointer to the first element and a count and do pointer arithmetic just like in C.

In my various projects I use a mixture of Delphi and C/C++, sometimes both in the same project. As grasshopa55 said, speed of compiled is not really an issue today unless you are an absolute optimization freak wanting the highest performance possible.

Note that I am typing this while waiting for the PS2 version of our game to build. We get an average of about 15 minutes per rebuild using a GNU C++ compiler.

Steve ''Sly'' Williams  Monkey Wrangler  Krome Studios

Share this post


Link to post
Share on other sites
Alimonster    185
Thanks for the mention on Turbo, Sly! My web site isn''t finished yet, so you pre-empted me. There''s plently more good stuff in the pipeline... including registering it with search engines (lol ).

Anyway, here''s something I''ve found about Java. It says "Performance tests show Java as fast as C++". Whether you believe it is another story, of course. I''m doing a Java Honours project, and can say Java''s speed is improving (esp. with HotSpot), but I think it''s still a little slower than C++ (15-20% sometimes, on average, I think I read). Anyway, the link:

Java does''t suck, says Javaworld

I''ve also found the link about multiple inheritance in Delphi. Tantalisingly, I can''t read it, because I''m not a subscriber!

Delphi goes to the wrong side of the tracks (again, my spin ).

Also (link mania ), here''s Alex Champandard''s site about TerraVox. He says it''s good. Check out TerraVox, because it''s real purty.

TerraVox and Intel compiler mention.

Alistair Keys

Share this post


Link to post
Share on other sites
Silent Error    122
quote:
Original post by grasshopa55
As for execution speed, unless you are planning on supporting older systems, 386, 486, etc, it may be a mute point. Computer hardware is so inexpensive these days, that you don''t need to be as stingy when it comes to CPU cycles.


Sorry grasshopa, I do not agree. While hardware has gotten better and cheaper, and optimizing the hell out of your code isn''t as important as it once was, I still believe that allowing yourself to think this way only promotes laziness. Last thing this world needs is more lazy programmers, I''m sick of the ones I work with.

My two cents, take it, leave it, throw it in the fountain for all I care, but at least you listened.



If only debugging were as easy as killing cockroaches... *sigh*

Share this post


Link to post
Share on other sites
NuffSaid    122
The Java article doesn''t address a major issue with Java. Slow GUI performance.

Until the performance of Swing/JFC improves, there''s still a very good reason to stick with C++ and Native apps.

Share this post


Link to post
Share on other sites
grasshopa55    128
Silent Error,

I completely agree with you in optimizing your code, but the argument here was which compiler produces the fastest code. I work as a developer doing performance engineering work. In every project I work on, performance is at the heart of it. I don''t consider myself a lazy programmer, but I also don''t see the need to optimize code so far down that the only way to get it faster is with ASM. The days of DOS and 640K restrictions are long gone. Don''t get me wrong, I am not advocating sloppy code, I am saying, you don''t need to be so stingy.

A good optimization/error checking tool is NuMega''s DevPartner. Bounds Checker has saved me a great deal of time tracking down memory leaks and other, sneaky, silent errors :-P. Back to the topic, it is not the compiler per se that produces the fastest executing code, its the programmer behind the code that determines its speed. Again, I feel as though this argument is kind of mute. Oh well, take it or leave it.


-----------------------------
kevin@mayday-anime.com
http://games.mayday-anime.com

Share this post


Link to post
Share on other sites