taltamir
Posts: 1290
Joined: 4/2/2010 Status: offline
|
Firstly, I would like to apologize, I am not familiar with VB.NET specifically and just went with a generic "all languages and compilers provide different performance results"... however I didn't realize how closely related VB.NET and C# are to each other, nor did I realize that you meant to compile both using the same related compiler (VS2005) and that the claim to identical performance was only for code in those 2 specific languages, while accepting that in general different languages have different performance metrics... This drastically alters the nature of the discussion. that being said, "the same compiler" (VS2005) still has to use different code to compile different languages, and those are different languages (thus code will always be somewhat different), and they SHOULD still have differing performance despite their similarity, and sharing of compiler. http://upload.wikimedia.org/wikipedia/commons/6/6f/CLR_diag.svg See the part where there is a C# compiler (which converts C# code to CIL) and a VB.NET compiler (which converts VB.NET code to CIL)? that is where the performance delta would be introduced, since they are bound to be different (perfection doesn't exist; and even if those were perfect compilers, the language differences come into play) A quick google search found something interesting about that: quote:
C# code might run slightly faster in a few circumstances; for example, the C# compilter generates code that reclaims the memory used by objects more aggressively than under Visual Basic. However, most of the time the difference in the performance won't be greater than 5 percent, so it's hardly an argument for selecting one language over the other. from Programming Microsoft Visual Basic.Net http://www.amazon.com/Programming-Microsoft-Visual-Basic-Reference/dp/0735613753 quote taken from this discussion: http://www.vbforums.com/showthread.php?t=169894 which also indicates a performance delta between VB.NET and C#. There is a decisive lack of performance benchmark comparisons of those two specific languages when using VS2005. I found a benchmark showing VB6 to outperform VB.NET by 81%, I found the benchmarks I posted in a previous thread, but aside from that one discussion (which DOES show a difference between VB.NET and C#) I am not finding all that much evidence either way. What I am saying is: 1. different languages are known to produce different performance. 2. different compilers are known to produce different performance. 3. VS2005 still has to use a different compiler for VB.NET and C# code. 4. There is no reason or explanation why those two languages are an exception to said rule. 5. I actually found a benchmark supporting my claim. 6. I actually found that a book about programming in said language gives a technical reason for a performance delta between the two. PS. If, for some reason, you had identical bytecode (CIL) produced by a VB.NET and a C# program, the fact that they share the CLR will indeed result in same native code and same performanc... however, the problem is in that IF... C# and VB.NET do NOT produce identical bytecode (CIL code) because they are different languages and use different compilers.
< Message edited by taltamir -- 8/19/2010 12:47:10 PM >
_____________________________
I do not have a superman complex; for I am God, not Superman.
|