If you have done some profiling and have discovered that load time is really the problem in your case, then there is a simple change that you may be able to employ to speed up load time. Have a look at autouse and/or Class::AutoUse. You can use these to prevent a module from loading until it is actually used in the program.
But this will only help with scripts that run once and exit (ie not mod_perl or PersistentPerl), and will not do anything if these scripts always use some small part of most of the modules (Since they will all need to be loaded anyway). Also, it will obviously only work if load time is really your bottleneck...
Another option would be to look at using PersistentPerl, which will load your script once, and then keep it in memory. This removes the startup cost of the scripts, but does nothing to improve execution time. Also with PersistentPerl you will need to be careful with things like global variables and memory leaks, since the process will have a long life.
- Cees
In reply to Re: Private module organisation
by cees
in thread Private module organisation
by Smoothhound
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |