Silverlight Is there a performance difference between C # and VB.net event handlers?

Being new to .NET and Silverlight, I noticed that many of the tutorials for Silverlight (Tim Hayers' blog, Silverlight TV, etc.) are in C #. I know that the general difference between VB and C # is usually preferable.

However, one of the main differences that I noticed is how C # and VB.NET handle events. Is this just a syntactic difference, or is it one or the other optimized to handle events better? For example, they are both compiled to the same intermediate language, but is the code identical? Since Silverlight relies heavily on this, I thought it might be worth considering.

Given the experience on this forum, I was wondering if someone had done a research on this or a performance test.

+5
source share
2 answers

The code that is generated may not coincide with the instruction, but the overall effect is the same. You should not see a difference in performance in this area.

VB.NET has two syntaxes for events - AddHandlerwhich is the same as C # +=, and Handleswhich is just syntactic sugar for AddHandlerin the constructor.

+2
source

They both compile to IL (or in this case byteecode Silverlight) and must do exactly the same thing. Any differences should be just syntactic.

+2

All Articles