I don't mean lines of code in a given Sub or Function, but the overall size
of code modules.
I wouldn't expect it to matter much if at all, but I recently moved a good
bit of code out of one large module (80 subs or functions) and put it into
one of 5 new modules, and now my system seems significantly more responsive.
Or is it just wishful thinking?
Br@dley - 22 Mar 2006 00:27 GMT
> I don't mean lines of code in a given Sub or Function, but the
> overall size of code modules.
[quoted text clipped - 5 lines]
>
> Or is it just wishful thinking?
If I remember correctly when you use a function from a module the entire
module is loaded into memory? Thus, if your module is smaller it may run
faster.
For readability it's a good idea to put code into separate modules
anyway(eg. all functions that alter an employee record).

Signature
regards,
Br@dley
Anthony England - 22 Mar 2006 00:47 GMT
>I don't mean lines of code in a given Sub or Function, but the overall size
> of code modules.
[quoted text clipped - 5 lines]
>
> Or is it just wishful thinking?
Theoretically splitting code up into smaller sections should put less of a
strain on the system. If you have 80 subs and functions in one module, then
if you call one, the whole lot gets loaded, whereas perhaps you only needed
a few.
Having said that, I have never really noticed a difference and my modules
are built up by logically organizing my code into blocks. In other words,
readability and logic is my priority. However, you are now in a position to
do some empirical tests. Take 2 versions of the database and make some
measurements - then *you* can let *us* know, what practical difference you
measured.
David W. Fenton - 22 Mar 2006 01:15 GMT
> I don't mean lines of code in a given Sub or Function, but the
> overall size of code modules.
[quoted text clipped - 5 lines]
>
> Or is it just wishful thinking?
I think it's probably a result of discarding old compiled code and
getting freshly compiled code to replace it.
If you coded with COMPILE ON DEMAND off all the time, you'd get the
same benefit.

Signature
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
DFS - 22 Mar 2006 02:31 GMT
>> I don't mean lines of code in a given Sub or Function, but the
>> overall size of code modules.
[quoted text clipped - 8 lines]
> I think it's probably a result of discarding old compiled code and
> getting freshly compiled code to replace it.
OK. I'm also going to decompile, save, compact/repair, save, recompile,
save the beast and see what happens.
> If you coded with COMPILE ON DEMAND off all the time, you'd get the
> same benefit.
I do code with Compile on Demand off all the time.