[AccessD] Missing references

JWColby jwcolby at colbyconsulting.com
Fri Feb 16 09:44:01 CST 2007


Excuse me, I misspoke.  The reference is resolved at the SET statement, not
the dim statement.

(flogging self with a cat-o-nines)

John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of JWColby
Sent: Friday, February 16, 2007 10:39 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Missing references

It is quantifiable.  I have a class for timing things and you can do late
binding vs. early binding in a loop a million times to measure the effects
of each.  Essentially binding requires the compiler to look up the object in
an object table to obtain the pointer to the object as well as the
parameters, their types, the return type if any etc.  Early binding does
that at compile time, once.  Late binding does the exact same thing at run
time, every time the object is resolved.  

The question is, how often is it done?  For example, if you have a global
reference to a word object, at runtime the object has to be resolved, but
since it is a global variable, it is only resolved once, and so the hit is a
once-off affair.  

Now take the example of a reference to a word object in the header of a
class module.  Now this has to be done once, every time the class loads, for
each instance of the class loading.

Now take the example of a reference to a cell in a spreadsheet dimensioned
in a method of a class.  The object has to be resolved every time the
function is called.  That may be once, or it may be hundreds or thousands of
times.  

Notice that in ALL cases, the object is resolved ONCE for each dimension
statement.  The difference between these three examples is the LOCATION of
the dimension statement.  

It is actually possible in VBA to dimension an object down in code, so you
could literally dimension an object inside of a loop.  Generally speaking
that would be a disaster using late binding.  

Actually dimensioning a variable of any kind down in the middle of code is
considered bad practice anyway.

DREW are you listening?

Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.
Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.
Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.
Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.
Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.
Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.  Bad Practice.
Bad Practice.  

<HUGE grin>

John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com
Sent: Friday, February 16, 2007 10:21 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Missing references

Is this verifiable, Jim? I haven't ever used late-binding, which I admit has
caused various installation issues, but I am curious. Is this a thumbnail
calculation or can you supply concrete arithmetical evidence?

A.



----- Original Message ----
From: Jim Dettman <jimdettman at verizon.net>
To: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
Sent: Friday, February 16, 2007 9:49:44 AM
Subject: Re: [AccessD] Missing references


Bryan,

  One thing you didn't mention is the performance hit; late binding costs
you 10-15% for every operation perform.

Jim.
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list