473,385 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Do smaller modules mean a faster system?

DFS
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?


Mar 21 '06 #1
4 1435
Br
DFS wrote:
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?


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).
--
regards,

Br@dley
Mar 21 '06 #2
"DFS" <nospam@dfs_.com> wrote in message
news:BD**************@bignews1.bellsouth.net...
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?

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.
Mar 21 '06 #3
"DFS" <nospam@dfs_.com> wrote in
news:BD**************@bignews1.bellsouth.net:
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?


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.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Mar 22 '06 #4
DFS
David W. Fenton wrote:
"DFS" <nospam@dfs_.com> wrote in
news:BD**************@bignews1.bellsouth.net:
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?
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.

Mar 22 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Andreas Neudecker | last post by:
Hi. I have a "style" question: Sometimes, modules will only be used in a particular, optional, part of a program (function, class), that will not always be used when the application is run. So I...
9
by: Emmanuel Charruau | last post by:
Hi, I am looking for a class or any information which would allow me to make communicate mini-module in c++. I have been looking on the net for some examples of such implementation, but I did...
2
by: Stormbringer | last post by:
Hello, I am trying to make an executable for one of my applications with cx freeze. All works ok although I must include python24.dll with it if I want to redistribute it. The big problem is...
5
by: Alex | last post by:
Hi, this is my first mail to the list so please correct me if Ive done anything wrong. What Im trying to figure out is a good way to organise my code. One class per .py file is a system I like,...
173
by: Zytan | last post by:
I've read the docs on this, but one thing was left unclear. It seems as though a Module does not have to be fully qualified. Is this the case? I have source that apparently shows this. Are...
2
by: erikcw | last post by:
Hi, I need to match 3 small strings in a small text file (about 200 words of text). Would it be faster to write 1 compiled regex that matches all 3 substrings in one go, or to use 3 separate...
0
by: Robert Kern | last post by:
Daniel Fetchinson wrote: Style-checkers will help with this. pylint, pychecker, and pyflakes are all good tools. I tend to use pyflakes most often. It's small and doesn't do as much as the...
2
by: John Nagle | last post by:
koblas wrote: PyPy was supposed to help, but that project has been dragging on for half a decade now. Personally, I think the Shed Skin approach is more promising. PyPy has too many different...
2
by: Tree*Rat | last post by:
Trying to reduce alot of my codes size and am having no joy with this code. How can I get this smaller? // Block $prefix_length = strlen( PREFIX_BLOCKS ); $block_dir = @opendir($root_path ....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.