J
jamil
While browsing MSDN, I found an article related to performance in
VB.NET programs. The article is dated 2002, and I am not sure if the
information below is still correct:
http://msdn2.microsoft.com/en-us/library/aa289513(VS.71).aspx#vbtchperfoptanchor5
Calling and Returning
....
Use the Return statement whenever your logic permits it. For more
information, see Return Statement. The compiler can optimize the code
better than if you use Exit Function, Exit Property, or Exit Sub, or
allow the End Function, End Get, End Set, or End Sub statement to
generate a return.
Now reading this, I get the impressions that I should add a return to
all of my subroutines instead of relying on End Sub. If this is
indeed true, this seems like a compiler bug that I hope has been fixed
by now.
Any comments on this?
VB.NET programs. The article is dated 2002, and I am not sure if the
information below is still correct:
http://msdn2.microsoft.com/en-us/library/aa289513(VS.71).aspx#vbtchperfoptanchor5
Calling and Returning
....
Use the Return statement whenever your logic permits it. For more
information, see Return Statement. The compiler can optimize the code
better than if you use Exit Function, Exit Property, or Exit Sub, or
allow the End Function, End Get, End Set, or End Sub statement to
generate a return.
Now reading this, I get the impressions that I should add a return to
all of my subroutines instead of relying on End Sub. If this is
indeed true, this seems like a compiler bug that I hope has been fixed
by now.
Any comments on this?