Click here to Skip to main content
15,880,725 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: tiny tiny REGEX problem Pin
Guffa17-Aug-07 6:25
Guffa17-Aug-07 6:25 
GeneralRe: tiny tiny REGEX problem Pin
ant1xxx17-Aug-07 7:49
ant1xxx17-Aug-07 7:49 
GeneralRe: tiny tiny REGEX problem Pin
Guffa17-Aug-07 14:35
Guffa17-Aug-07 14:35 
QuestionByval Vs ByRef Performance Pin
K.P.Kannan22-May-07 4:09
K.P.Kannan22-May-07 4:09 
AnswerRe: Byval Vs ByRef Performance Pin
Kschuler22-May-07 5:05
Kschuler22-May-07 5:05 
GeneralRe: Byval Vs ByRef Performance Pin
GregScott22-May-07 7:31
GregScott22-May-07 7:31 
AnswerRe: Byval Vs ByRef Performance Pin
MidwestLimey22-May-07 7:14
professionalMidwestLimey22-May-07 7:14 
AnswerRe: Byval Vs ByRef Performance Pin
Guffa22-May-07 9:37
Guffa22-May-07 9:37 
K.P.Kannan wrote:
The method doesn't make any changes to the variables


Then you should not pass anything by reference.

K.P.Kannan wrote:
Byval or Byref - which will be faster-multiple times and multilevels calling?


ByVal will be faster, and that is the default way of passing parameters.

When you pass an object by value, you are passing a copy of the reference to the object, and it will be handled just as afficiently as a local variable in the method.

When you pass an object by reference, you are passing a reference to the reference to the object. Whenever you use it in the method, it has to be dereferenced, which adds a small overhead each time.

The ByVal and ByRef keywords are mostly kept for compatibility reasons. In object oriented programming they are very rarely used at all.

K.P.Kannan wrote:
Will that be a good idea to have multiple levels of methods to be called multiple times.


Unless you are making a huge number of calls to the methods, it doesn't matter much.

K.P.Kannan wrote:
We have lot of local variables. Will the garbage collectors's headache be more in creating and destroying the objects?


Local variables are allocated on the stack, and don't have to be garbage collected at all. If you have local variables that are references, and create objects for those references, the objects will of course be garbage collected.

Creating and freeing objects are considerably cheaper in .NET than it was in VB6. As long as you make use of the objects, you should not normally be concerned with the cost of creating and freeing them. If you create and free the same kind of objects a lot, you might consider a way of reusing them, but on the other hand many objects are not even built to be reused in that way.


---
single minded; short sighted; long gone;

AnswerRe: Byval Vs ByRef Performance Pin
K.P.Kannan22-May-07 20:10
K.P.Kannan22-May-07 20:10 
Questionerror handling Pin
WhiteGirl2322-May-07 3:52
WhiteGirl2322-May-07 3:52 
AnswerRe: error handling Pin
Dave Herren22-May-07 3:55
Dave Herren22-May-07 3:55 
Questionwininet in vb.net Pin
psiva198422-May-07 2:22
psiva198422-May-07 2:22 
AnswerRe: wininet in vb.net Pin
Dave Kreskowiak22-May-07 17:42
mveDave Kreskowiak22-May-07 17:42 
GeneralRe: wininet in vb.net Pin
psiva198422-May-07 18:52
psiva198422-May-07 18:52 
GeneralRe: wininet in vb.net Pin
psiva198423-May-07 1:17
psiva198423-May-07 1:17 
GeneralRe: wininet in vb.net Pin
Dave Kreskowiak23-May-07 15:36
mveDave Kreskowiak23-May-07 15:36 
QuestionHow to disable Ctrl P keys of webbrowser control Pin
koolprasad200322-May-07 2:07
professionalkoolprasad200322-May-07 2:07 
AnswerRe: How to disable Ctrl P keys of webbrowser control Pin
codemunkeh22-May-07 10:12
codemunkeh22-May-07 10:12 
GeneralRe: How to disable Ctrl P keys of webbrowser control Pin
koolprasad200322-May-07 18:53
professionalkoolprasad200322-May-07 18:53 
Questionhelp meeeeeee.......... Pin
choorakkuttyil22-May-07 1:42
choorakkuttyil22-May-07 1:42 
AnswerRe: help meeeeeee.......... Pin
ne0h22-May-07 2:19
ne0h22-May-07 2:19 
AnswerFrequent message title abuser! Pin
leckey22-May-07 3:08
leckey22-May-07 3:08 
QuestionExport from Crystal report to MS Access Pin
charchabil0322-May-07 1:23
charchabil0322-May-07 1:23 
QuestionHow to compare two types Pin
eschem22-May-07 1:03
eschem22-May-07 1:03 
AnswerRe: How to compare two types Pin
RichardBerry22-May-07 1:36
RichardBerry22-May-07 1:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.