Originally posted by: JACKDRUID
C# is not compiled to be read directly by your CPU/os. It is compile to msil (.net version of aseembly language) to be read and executed by .net framwork.
C++ on the other hand, is compiled to be read directly by the CPU/os. so C# will always be slower than C++ in term of speed.
When is C# faster than C++?Originally posted by: Crusty
Originally posted by: JACKDRUID
C# is not compiled to be read directly by your CPU/os. It is compile to msil (.net version of aseembly language) to be read and executed by .net framwork.
C++ on the other hand, is compiled to be read directly by the CPU/os. so C# will always be slower than C++ in term of speed.
That's a bad generalization. Yes, there is extra overhead and in most cases the exact same code will be faster in C++ then in C#, but not always. It totally depends on the environment and applications.
Originally posted by: Crusty
Originally posted by: JACKDRUID
C# is not compiled to be read directly by your CPU/os. It is compile to msil (.net version of aseembly language) to be read and executed by .net framwork.
C++ on the other hand, is compiled to be read directly by the CPU/os. so C# will always be slower than C++ in term of speed.
That's a bad generalization. Yes, there is extra overhead and in most cases the exact same code will be faster in C++ then in C#, but not always. It totally depends on the environment and applications.
Originally posted by: suszterpatt
When is C# faster than C++?Originally posted by: Crusty
Originally posted by: JACKDRUID
C# is not compiled to be read directly by your CPU/os. It is compile to msil (.net version of aseembly language) to be read and executed by .net framwork.
C++ on the other hand, is compiled to be read directly by the CPU/os. so C# will always be slower than C++ in term of speed.
That's a bad generalization. Yes, there is extra overhead and in most cases the exact same code will be faster in C++ then in C#, but not always. It totally depends on the environment and applications.
Originally posted by: suszterpatt
When is C# faster than C++?Originally posted by: Crusty
Originally posted by: JACKDRUID
C# is not compiled to be read directly by your CPU/os. It is compile to msil (.net version of aseembly language) to be read and executed by .net framwork.
C++ on the other hand, is compiled to be read directly by the CPU/os. so C# will always be slower than C++ in term of speed.
That's a bad generalization. Yes, there is extra overhead and in most cases the exact same code will be faster in C++ then in C#, but not always. It totally depends on the environment and applications.
Originally posted by: Dhaval00
In general, C++ would own C# and JAVA [again... this is an opinion, not a writing on the wall]
.
That's not true at all. C# runs native code and not "interpreted" code like you are thinking. The msil is "compiled" when you run it the first time and it uses that every time you execute afterwards. That's what Paint.NET (which is written in C#) is doing when it says "optimizing for your system" for the last few minutes of the install.Originally posted by: JACKDRUID
You are correct here, because compiled code is always faster than almost-compiled code.Originally posted by: Dhaval00
In general, C++ would own C# and JAVA [again... this is an opinion, not a writing on the wall]
.
That's not true at all. C# runs native code and not "interpreted" code like you are thinking.
The msil is "compiled" when you run it the first time and it uses that every time you execute afterwards.
Originally posted by: JACKDRUID
That's not true at all. C# runs native code and not "interpreted" code like you are thinking.
No disrespect but interpretation has no meaning in compiled language. It is a phrase used for scripting languages.
The msil is "compiled" when you run it the first time and it uses that every time you execute afterwards.
wrong where would you then stored the compiled information?
msIL is compiled into binary code and put into system memory , it will be kept in memory for the rest of of the execution. That means when you close the program or shut down the machine, and if its not still in system cache, the next time you start the program it will have to be compiled again.
everytime you run the program, it will be slower than C++ compiled code.
the execution may be the same, but it will take longer to start, therefore
COMPILED CODE IS ALWAYS FASTER THAN IL
I'll admit I gave a poor description of the JIT compiler. You are still wrong that it is always faster. Always is an absolute term, and I gave an example of where C# can be faster. In general C++ is faster, but not always.Originally posted by: JACKDRUID
That's not true at all. C# runs native code and not "interpreted" code like you are thinking.
No disrespect but interpretation has no meaning in compiled language. It is a phrase used for scripting languages.
The msil is "compiled" when you run it the first time and it uses that every time you execute afterwards.
wrong where would you then stored the compiled information?
msIL is compiled into binary code and put into system memory , it will be kept in memory for the rest of of the execution. That means when you close the program or shut down the machine, and if its not still in system cache, the next time you start the program it will have to be compiled again.
everytime you run the program, it will be slower than C++ compiled code.
the execution may be the same, but it will take longer to start, therefore
COMPILED CODE IS ALWAYS FASTER THAN IL
Originally posted by: Kyteland
I'll admit I gave a poor description of the JIT compiler. You are still wrong that it is always faster. Always is an absolute term, and I gave an example of where C# can be faster. In general C++ is faster, but not always.
Originally posted by: Crusty
In the end you are running compiled code. How you get there has nothing to do with the speed of the application.
Different processors within the same family aren't all the same. There are cases where C# is faster than a similar C++ program because it can take certain optimizations into account with the JIT compiler that, unless you compile for your exact processor, you aren't going to get with a C++ distributable.Originally posted by: JACKDRUID
Originally posted by: Kyteland
I'll admit I gave a poor description of the JIT compiler. You are still wrong that it is always faster. Always is an absolute term, and I gave an example of where C# can be faster. In general C++ is faster, but not always.
I don't see how your example proves c# can be faster.... do you mind pointing it out?
Originally posted by: JACKDRUID
Originally posted by: Crusty
In the end you are running compiled code. How you get there has nothing to do with the speed of the application.
umm... everytime you run the application it will start faster.... that has nothing to do with speed...?
say you have 2 computers, one boots up faster than the other, and run equally afterwards... and you gonna consider they they are equally as fast?
which one would you buy? if everything else stay constant?
Originally posted by: Crusty
, just because a program loads faster does not mean that it is always faster.. which goes to my first post about your generalization.
Originally posted by Kateland
There are cases where C# is faster than a similar C++ program because it can take certain optimizations into account with the JIT compiler