Author |
Message |
Jay #1 / 11
|
 * Early binding or late binding
Could someone tell me which is more efficient performance-wise, Early Binding or Late Binding? Thanks.
|
Sun, 08 Sep 2002 03:00:00 GMT |
|
 |
Sixto Santo #2 / 11
|
 * Early binding or late binding
Hello Jay! Early-binding is faster than late-binding. In late binding (when you declare an object variable as Object), each time the application use the object, VB must check the validity of it. So it binds at run-time, hence its name. In early-binding, the binding and check procedures occurs at development time (or more correctly, at compile time), that means that the application doesn't need to verify the validity of the object each time giving better (much better) performance. Regards, Sixto
Quote: > Could someone tell me which is more efficient performance-wise, Early > Binding or Late Binding? > Thanks.
|
Sun, 08 Sep 2002 03:00:00 GMT |
|
 |
cgil #3 / 11
|
 * Early binding or late binding
Early binding is much more performant and also easy to use because by using 1.earliy binding: Dim oAdoRs as new ADODB.Recordset 2.instead of late bound: Dim oAdoRs as Object Set oAdoRs=createobject("ADODB.Recordset") you will benefit (with 1.)from intelisense easy typing
|
Mon, 09 Sep 2002 03:00:00 GMT |
|
 |
#4 / 11
|
 * Early binding or late binding
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
 |
Jay #5 / 11
|
 * Early binding or late binding
Thanks for your reply. Someone at Microsoft told me that the following is the best binding approach: Dim oAdoRs as ADODB.Recordset ....... Set oAdoRs = CreateObject("ADODB.Recordset") This is *almost* like late-binding, but the Dim statement uses the actual object class instead of "Object". The Microsoft guy told me that performance-wise, this is even better than "Dim oAdoRs as new ADODB.Recordset". What do you think? Quote:
>Early binding is much more performant >and also easy to use >because by using >1.earliy binding: > Dim oAdoRs as new ADODB.Recordset >2.instead of late bound: > Dim oAdoRs as Object > Set oAdoRs=createobject("ADODB.Recordset") >you will benefit (with 1.)from intelisense easy typing
|
Mon, 09 Sep 2002 03:00:00 GMT |
|
 |
Jonel Riento #6 / 11
|
 * Early binding or late binding
you'll benefit with this approach eventually, i've used this ever since i read this from MSDN and have stick with it.
Quote: > Thanks for your reply. Someone at Microsoft told me that the following is > the best binding approach: > Dim oAdoRs as ADODB.Recordset > ....... > Set oAdoRs = CreateObject("ADODB.Recordset") > This is *almost* like late-binding, but the Dim statement uses the actual > object class instead of "Object". The Microsoft guy told me that > performance-wise, this is even better than "Dim oAdoRs as new > ADODB.Recordset". > What do you think?
> >Early binding is much more performant > >and also easy to use > >because by using > >1.earliy binding: > > Dim oAdoRs as new ADODB.Recordset > >2.instead of late bound: > > Dim oAdoRs as Object > > Set oAdoRs=createobject("ADODB.Recordset") > >you will benefit (with 1.)from intelisense easy typing
|
Mon, 09 Sep 2002 03:00:00 GMT |
|
 |
Jay #7 / 11
|
 * Early binding or late binding
Quote: >> Dim oAdoRs as ADODB.Recordset >> ....... >> Set oAdoRs = CreateObject("ADODB.Recordset")
By the way, instead of CreateObject("ADODB.Recordset"), could I also do this? Set oAdoRs = new ADODB.Recordset Quote:
>you'll benefit with this approach eventually, i've used this ever since i >read this from MSDN and have stick with it.
>> Thanks for your reply. Someone at Microsoft told me that the following is >> the best binding approach: >> Dim oAdoRs as ADODB.Recordset >> ....... >> Set oAdoRs = CreateObject("ADODB.Recordset") >> This is *almost* like late-binding, but the Dim statement uses the actual >> object class instead of "Object". The Microsoft guy told me that >> performance-wise, this is even better than "Dim oAdoRs as new >> ADODB.Recordset". >> What do you think?
>> >Early binding is much more performant >> >and also easy to use >> >because by using >> >1.earliy binding: >> > Dim oAdoRs as new ADODB.Recordset >> >2.instead of late bound: >> > Dim oAdoRs as Object >> > Set oAdoRs=createobject("ADODB.Recordset") >> >you will benefit (with 1.)from intelisense easy typing
|
Wed, 11 Sep 2002 03:00:00 GMT |
|
 |
Htoo Myin #8 / 11
|
 * Early binding or late binding
Hi As my understanding "CreateObject" has one extra registry lookup than "new". I use Dim oAdoRs as ADODB.Recordset set oADORs = new ADODB.Recordset I am very interested to know how "CreateObject" has a better perform than "new" statement. If someone point me to that MSDN article title or number I would be most appriciated. Thanks. Htoo
Quote: > >> Dim oAdoRs as ADODB.Recordset > >> ....... > >> Set oAdoRs = CreateObject("ADODB.Recordset") > By the way, instead of CreateObject("ADODB.Recordset"), could I also do > this? > Set oAdoRs = new ADODB.Recordset
> >you'll benefit with this approach eventually, i've used this ever since i > >read this from MSDN and have stick with it.
> >> Thanks for your reply. Someone at Microsoft told me that the following > is > >> the best binding approach: > >> Dim oAdoRs as ADODB.Recordset > >> ....... > >> Set oAdoRs = CreateObject("ADODB.Recordset") > >> This is *almost* like late-binding, but the Dim statement uses the actual > >> object class instead of "Object". The Microsoft guy told me that > >> performance-wise, this is even better than "Dim oAdoRs as new > >> ADODB.Recordset". > >> What do you think?
> >> >Early binding is much more performant > >> >and also easy to use > >> >because by using > >> >1.earliy binding: > >> > Dim oAdoRs as new ADODB.Recordset > >> >2.instead of late bound: > >> > Dim oAdoRs as Object > >> > Set oAdoRs=createobject("ADODB.Recordset") > >> >you will benefit (with 1.)from intelisense easy typing
|
Sun, 15 Sep 2002 03:00:00 GMT |
|
 |
Dan Billingsle #9 / 11
|
 * Early binding or late binding
The use of "new" has been vehemently shunned at the last 2-3 local MSDN cafe's I attended. Microsoft's current position seems to be not to use it. I don't remember the exact explanation, but one of them given had something to do with "new" looking first to see if there is an instance of the object already, and taking some kind of COPY of that one. It's been a while, but I seem to remember the presenter making some kind of issue about state.
Quote: > Hi > As my understanding "CreateObject" has one extra registry lookup than "new". > I use > Dim oAdoRs as ADODB.Recordset > set oADORs = new ADODB.Recordset > I am very interested to know how "CreateObject" has a better perform than > "new" statement. If someone point me to that MSDN article title or number I > would be most appriciated. > Thanks.
|
Mon, 16 Sep 2002 03:00:00 GMT |
|
 |
Microsof #10 / 11
|
 * Early binding or late binding
Using new to implicitly instantiate an object is what they were most likely objecting to. Using it to explicitly instantitate an object is perfectly fine and normal for a male your age. Bad: Dim x As New ObjectType Good: Dim x As ObjectType : Set x = New ObjectType
Quote: > The use of "new" has been vehemently shunned at the last 2-3 local MSDN > cafe's I attended. Microsoft's current position seems to be not to use it. > I don't remember the exact explanation, but one of them given had something > to do with "new" looking first to see if there is an instance of the object > already, and taking some kind of COPY of that one. It's been a while, but I > seem to remember the presenter making some kind of issue about state.
> > Hi > > As my understanding "CreateObject" has one extra registry lookup than > "new". > > I use > > Dim oAdoRs as ADODB.Recordset > > set oADORs = new ADODB.Recordset > > I am very interested to know how "CreateObject" has a better perform than > > "new" statement. If someone point me to that MSDN article title or number > I > > would be most appriciated. > > Thanks.
|
Sat, 28 Sep 2002 03:00:00 GMT |
|
 |
Kirk Allen Evan #11 / 11
|
 * Early binding or late binding
This is how you want to do it if you are using COM+ or MTS because use of the New keyword bypasses the current context and because MTS can return a reference to a cached object instance when CreateObject is used instead of creating a new one by using New. Kirk Allen Evans
Quote:
> Thanks for your reply. Someone at Microsoft told me that the following is > the best binding approach: > Dim oAdoRs as ADODB.Recordset > ....... > Set oAdoRs = CreateObject("ADODB.Recordset") > This is *almost* like late-binding, but the Dim statement uses the actual > object class instead of "Object". The Microsoft guy told me that > performance-wise, this is even better than "Dim oAdoRs as new > ADODB.Recordset". > What do you think?
> >Early binding is much more performant > >and also easy to use > >because by using > >1.earliy binding: > > Dim oAdoRs as new ADODB.Recordset > >2.instead of late bound: > > Dim oAdoRs as Object > > Set oAdoRs=createobject("ADODB.Recordset") > >you will benefit (with 1.)from intelisense easy typing
|
Sat, 28 Sep 2002 03:00:00 GMT |
|
|