Module Efficiency 
Author Message
 Module Efficiency

Is there a 'rule of thumb' regarding efficient module size?  I've
looked through the Camel Bluebook and Cookbooks and can't seem to find
one.

I'm buiding a web app that is fairly traditional though quite large:

- Reports,
- "Do Something",
- Application Admin (user profiles, etc.)

When is it more efficient to place all subroutines in one module and
refer to them in groups ( using %EXPORT_TAGS  ) or to move the groups
into smaller modules (e.g. Common.pm, Report.pm, DoSomething.pm
ApplicationAdmin.pm  ) that would be called individually as needed.

Thanks, Eric Moore



Tue, 20 Apr 2004 01:26:43 GMT  
 Module Efficiency
E. Moore wrote in comp.lang.perl.modules:

Quote:
> Is there a 'rule of thumb' regarding efficient module size?  I've
> looked through the Camel Bluebook and Cookbooks and can't seem to find
> one.

> I'm buiding a web app that is fairly traditional though quite large:

> - Reports,
> - "Do Something",
> - Application Admin (user profiles, etc.)

> When is it more efficient to place all subroutines in one module and
> refer to them in groups ( using %EXPORT_TAGS  ) or to move the groups
> into smaller modules (e.g. Common.pm, Report.pm, DoSomething.pm
> ApplicationAdmin.pm  ) that would be called individually as needed.

Smaller modules are usually preferred, esp. in CGI apps that are
recompiled each time they're run, to avoid loading and compiling code
that will not be used.

Using SelfLoader or AutoLoader is an alternative. Basically these
modules allows to load subroutines only when they're needed. AutoLoader
also splits your modules into smaller parts.

Both modules are standard, so you have their documentation available with
your perl installation.

--
No parrots were involved in an accident on the M-1 today when a Lorry carrying
High-octane fuel was in collison with a bollard. That's a BOLLARD and *NOT* a
PARROT. A spokesman for parrots said he was glad no parrots were involved.
    -- Monty Python, The News for Parrots



Tue, 20 Apr 2004 17:02:34 GMT  
 Module Efficiency

Quote:
> > When is it more efficient to place all subroutines in one module and
> > refer to them in groups ( using %EXPORT_TAGS  ) or to move the groups
> > into smaller modules (e.g. Common.pm, Report.pm, DoSomething.pm
> > ApplicationAdmin.pm  ) that would be called individually as needed.
> Smaller modules are usually preferred, esp. in CGI apps that are
> recompiled each time they're run, to avoid loading and compiling code
> that will not be used.

> Using SelfLoader or AutoLoader is an alternative. Basically these
> modules allows to load subroutines only when they're needed. AutoLoader
> also splits your modules into smaller parts.

> Both modules are standard, so you have their documentation available with
> your perl installation.

Thanks.  I checked the 'Cookbook'.  Looks fairly simple.  Eric


Wed, 21 Apr 2004 21:32:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Module load efficiency

2. Efficiency of some regexp patterns

3. Efficiency of some regexp patterns

4. Efficiency of some regexp patterns

5. Quoted String Efficiency

6. efficiency of a2p output?

7. Space efficiency

8. Unrolling eval loops for time efficiency

9. Interpreted or compiled -- Perl efficiency

10. Pattern Matching Efficiency

11. sorting efficiency in perl

12. matching matching quotes - efficiency wanted

 

 
Powered by phpBB® Forum Software