[.net] Visual Basic .NET vs C#

Started by
22 comments, last by DrGUI 18 years, 2 months ago
I remember being able to configure whether to use natiive or pcode in vb4. Might have been vb6.
Advertisement
Native compilation wasn't added to VB until VB5.
Quote:Original post by SiCrane
Native compilation wasn't added to VB until VB5.


I believe that was the common "include the runtime in the full assembly" bit that they are using for the java-to-native and the .net-to-native compilers.

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

Quote:Original post by SiCrane
Native compilation wasn't added to VB until VB5.


Right. I meant VB5. (Tough my memory still yells VB4 at me.)
I teleported home one night; With Ron and Sid and Meg; Ron stole Meggie's heart away; And I got Sydney's leg. <> I'm blogging, emo style
Quote:Original post by Anonymous Poster
I found that IL code, which .NET compilers create, is not optimal. It needs to do some optimization. And the speed of .Net applications is not so good with compare of unmanaged code i think.


I'm willing to be you're wrong. :-)

In fact, depending on the application, managed code will run faster than unmanaged code (true, it's a corner case). Generally speaking, there _is_ a performance impact, but depending on usage, it's quite low. Definitely in the "under 10%" range. I've seen some REALLY poor performing managed code in my life though. But I've also seen some really poor performaing native apps too.

And as far as IL optimization goes -- by all means send your resume to Microsoft. The CLR team would love to hire extremely intelligent developers that know how to further optimize the compilation of IL into native code. Honestly.
David "LetsKillDave" WellerNVIDIA Developer Programs ManagerPersonal blog http://letskilldave.comPersonal Twitterfeed: letskilldaveNVIDIA Developer Announcements Twitterfeed: nvidiadeveloper (clever name, eh? :-)
Quote:Original post by nihonlvr
I was wondering if the speed of all .NET languages are the same.


Generally speaking, the answer is "yes". However, each language does some things in slightly different ways when it generates IL. The variance is diminishing with each iteration of the CLR though. In the end, what will really matter is the syntax that you prefer to work in, rather than the performance characteristics of each language.


David "LetsKillDave" WellerNVIDIA Developer Programs ManagerPersonal blog http://letskilldave.comPersonal Twitterfeed: letskilldaveNVIDIA Developer Announcements Twitterfeed: nvidiadeveloper (clever name, eh? :-)
Quote:Original post by dgweller
Quote:Original post by Anonymous Poster
I found that IL code, which .NET compilers create, is not optimal. It needs to do some optimization. And the speed of .Net applications is not so good with compare of unmanaged code i think.


I'm willing to be you're wrong. :-)



I don't think he's entirely wrong - But it still doesn't matter :) - most of the actual optimizations are done at the JIT level - even though each language does emit slightly different IL (and again, the differences are usually so small as to be pretty much inconsequential), most serious optimizations will be done at JIT time, meaning that even non optimal JIT code will turn into very close to optimal machine code.

Btw, take what he said about submitting your resume seriously.
They are practicaly the same once compiled to IL now. There used to be some small differences in the beginning but not anymore.
This blog post seems to cover some of what we are discussing here. I thought I should share.

VB.NET and C# - Duplication of Effort?

His argues that both languages are becoming so similar that we might as well throw one out and focus on the other.

Quote:
I've always thought that the differences were just skins over IL myself.
Really the only time IL is significantly less performant than a comparable native app is if the developer does not fully understand optimization tricks with managed code. It's the same thing with native apps, new developers to C++ can do some stupid things that compromise performance. If you have a .NET developer that fully understands the .NET runtime and memory management then they can build comparable managed counterparts to native apps.

And for the 100th reply, all .NET languages compile down to COMPARABLE IL, it's not the same, but it's close. Different language constructs can introduce less or more IL than another language, though it's generally not much of a concern.

~Graham

This topic is closed to new replies.

Advertisement