[Hot Discussion] VB.NET vs. C#.NET by performance

Which one have the much better performance?

Which one is the best?
Parco Lee
Owner + Webmaster + System Engineer + Professional Programmer

SoftDweller Lab (a software laboratory)
http://www.softdweller.com
A professional laboratory for new technology softwares developing by .NET.

http://www.nowlover.com
0 SM 3/9/2004 6:49:28 PM
Hmmm, the discussion doesn't appear very hot.

By the way, the answer is its all personal taste,
give or take a few things that aren't important.
Thanks, Paul Wilson, ASPInsider, MC**

For the best .NET code, examples, and tools, visit:
WilsonDotNet.com, WilsonWebPortal.com, ORMapper.net
0 PaulWilson 3/10/2004 3:38:53 AM
I'd think that VB.net written with Option Strict On would give much the same performance as C# since you're compiling to much the same MSIL.

What will slow down performance in VB though is using Option Strict off, this allows you to have things like late binding and integer arithmetic on objects of unspecified type, so you'll be having a lot of work (boxing and unboxing, late binding, type conversion etc) happening at runtime that otherwise be put into your code at compile time. Yes it saves you a bit of typing, but it slows down your code.
0 jammycakes 3/10/2004 10:28:33 AM
Neither is Cobol.net is much faster than both.



Sorry couldn't resist. The Common Language Runtime uses IL. How you create the IL should be unimportant in terms of performance. Granted each language may steer you into writing code a certain way but you can write rubbish code in any language. Personally I've spent the last 10 years writing VB code and I've found C# easier than VB.net. But like others have said, its a personal choice. Having said that there are some things you can't do in each langauge. For example you can have different visibility of accessors on the same property in c# but you can in vb.net (although that's changing in the next version).
0 pkr 3/13/2004 10:53:45 AM
::The Common Language Runtime uses IL. How you create the IL should be unimportant in 

::terms of performance.
Interestingly enough, this simply is not true.
If you want performance, use Managed C++ - it ALSO emits IL, but somehow the C++ compiler - emits less and better optimized IL.
he language CAN do a difference, depending on how good the compiler is. And there ARE differences.
Thomas Tomiczek
PowerNodes ApS
(Microsoft MVP C#/.NET)
---
Building a Website? Try the PowerNodes CMS - http://www.powernodes.com/
0 thona 3/15/2004 4:06:17 AM
I'm not disputing your claim, but could you give some examples? Afterall the bulk of what you do uses the common framework. I'm interested cause that could have a real impact on the project I'm about to start.
0 pkr 3/15/2004 8:22:12 AM
If you want performance, use Managed C++ - it ALSO emits IL, but somehow the C++ compiler - emits less and better optimized IL.

The C++ compiler actually produces native code. It does emit MSIL as well but I think this is a case of "as well as" rather than "instead of". You can compile to native code only using the /clr:noassembly command line option.
0 jammycakes 3/16/2004 9:33:58 AM
Isn't that the same as pre-compiling any IL, i.e you skip the JIT phase - NGEN is it?

0 pkr 3/16/2004 11:18:07 AM
Not quite. The compiler can produce more tightly optimised code if it compiles directly to native code rather than IL.
0 jammycakes 3/16/2004 11:44:57 AM
Huh, interesting. I suppose the Microsoft defence for not doing that is you don't always know the spec of machine you're deploying to. So compiling to the target machine early on might produce far worse performance. Still, I have to say that for the majority (if not all) of the projects I work on, I know what machine it's going on. But then they'd have to call us back every time they upgraded their kit...I'm beginning to see a revenue stream here!! ;)

0 pkr 3/16/2004 12:47:00 PM
Reply:

(Thread closed)