Cor Ligthert [MVP] <no************@planet.nl> wrote:
No, it's not. There are a few cases where they generate different
enough IL that the JIT can inline the C# version but not the VB.NET
version. If you happen to be unlucky, that *could* make a significant
difference. Most of the time it wouldn't, but
Are you *100%* sure that a kind of this cannot be as well for VB.Net to C#?
While I don't know every bit of IL that can be generated, I've only
heard about it (and tested it for myself) with the C# compiler
generating the leaner code (in terms of bytes of IL; there are more IL
instructions, but they're shorter). I also believe VB.NET adds NOPs in
when it doesn't need to in some situations. I should add that all this
is with 1.1 - the 2.0 JIT probably has different inlining rules, and
the compilers may well be generating different code anyway.
I'd be happy to be shown an example where the VB.NET IL is faster, of
course. I suspect that if they exist I'd have heard about them, but
that doesn't mean they definitely don't exist. (Note that my post
didn't claim they didn't exist, either.)
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too