* Early binding or late binding 
Author Message
 * 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  
 * 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  
 * 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  
 * Early binding or late binding


Fri, 19 Jun 1992 00:00:00 GMT  
 * 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  
 * 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  
 * 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  
 * 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  
 * 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  
 * 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  
 * 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  
 
 [ 11 post ] 

 Relevant Pages 

1. early binding vs late binding

2. Early binding and Late binding

3. Early binding and Late binding in VB.

4. Early Binding and Late Binding

5. Early bind and Late bind in VB.

6. Early binding and Late binding in VB.

7. early binding vs late binding

8. Activex Server - Early Binding vs. Late Binding

9. Late Binding vs Early Binding in out-of-process servers

10. early binding / late binding

11. Early Binding - Late Binding

12. Powerpoint with early or late binding but INVISIBLE

 

 
Powered by phpBB® Forum Software