Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / March 2006

Tip: Looking for answers? Try searching our database.

Do smaller modules mean a faster system?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DFS - 22 Mar 2006 00:07 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.