language performance question...

  • Thread starter Thread starter Paul M
  • Start date Start date
P

Paul M

Can somebody please give me some coding examples in how C# written
applications perform better than VB.NEt applications?
I've read that .NET is written primarily for C# language and performance is
meant to be better for it.

thanks,
P.
 
I don't think that's truly the case. Because all the .Net languages compile
down to IL, there isactually very little performance difference. The tests
I've seen only show baout a 1 to 2% difference between various languages. C#
was just the new boy written for .Net and may be a little faster in some
things since it is not a re-write of an existing language. Basically though,
if a language's ability to compile down to IL is better than another, it
will be faster.Third-party .Net enabled languages may be right on par with
the default ones, or perhaps a tad slower if their compilers don't compile
to IL as efficiently. I remember reading that large parts of ASP.Net, if not
all parts, were actually written in C#, but that doesn't mean that C# code
runs better for ASP.Net than VB.Net and my performance tests haven't shown
that.


Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
The performance difference it relatively small. However, all .NET languages
are not equal. There have been projects that I've HAD to write in C# as
opposed to VB.NET because there were sertian things that I could not do with
VB.NET (e.g. serializing classes that had events)
 
Hi,

The differences are really small. Look at the following example in C#:

someValue = isConditionMet ? firstValue : anotherValue;

This generates a little bit more effective IL code than

If isConditionMet Then
someValue = firstValue
Else
someValue = anotherValue
EndIf

Marek
 
An article from 2001 based on the beta? Why would anyone want to see that at
this point!
 
Back
Top