Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Module Size Matters? 1

Status
Not open for further replies.

Akart

IS-IT--Management
Nov 14, 2002
71
AU
Hiya,

Can someone tell me if a module size will matter....

I Was planning to put all of my system functions in one module called system, this module will contain every sub and function that runs the entire functionality of the database. Will there be performance or any other issues arising from this?

Regardez,

Akartez
 
Access (97 and 2000) loads each module into a single block of memory. If you have a lot of code, and it's all in one module, you'll need a BIG memory block for it.

In a small-memory machine, that could be a problem, but it would occur only when the database was opened. Once it's open, you'd be unlikely to have any further memory problems in the Access window. You might, however, put a strain on other applications trying to run in what's left, and the result could be to slow everything down because of Windows swapping memory back and forth to disk.

If memory isn't a problem, though, having all your code in one module could actually make it run faster, because Access won't have as much memory management overhead. (It would still have to load form modules separately, so there would still be some overhead.)

The downside in that case, though, is that all your code would have to be loaded when the database is opened, which could make your startup slow.

Also, if anything happens in your application database that causes it to be decompiled, you might experience delays while the code is recompiled. You could prevent this by putting the module in a library database, and establishing a reference to the library database from your application database, but of course then you have another file to distribute to your users. (Not that that's a big hairy deal, in most cases.)

If you decide to try this, consider putting related procedures near each other in the module. Not only will this make it easier to work on the code in the future, but it can reduce the amount of page swapping that occurs at runtime, because procedures which call one another will be more likely to reside in the same page of memory. Rick Sprague
 
Rick,

Very nice explanation. Tried to give you a star, but popup killer stopped me.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.
 
Great insight, very helpful. Thanks.

A pink star for you =)

Akart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top