I have recently came across a mod_perl document that suggested Perl's
Method Interface is more 'memory friendly' compare to Perl's Function
Interface.

I'm not too sure I've got the meaning of this 'Method Interface' and
'Function Interface' correctly, is it referring to the procedural
function call and the Object Oriented Method invoking?  or is it trying
to suggest to use 'use' instead of 'require'?


Quote From : http://perl.apache.org/dist/mod_perl.html

Importing Functions
       When possible, avoid importing of a module functions into your
namespace. The aliases which are created can take up quite a
       bit of space. Try to use method interfaces and fully qualified
Package::function names instead. Here's a freshly started httpd
       who's served one request for a script using the CGI.pm method
interface:

        TTY   PID USERNAME  PRI NI   SIZE   RES  STATE   TIME %WCPU
%CPU COMMAND
          p4  5016 dougm     154 20  3808K  2636K sleep   0:01  9.62
4.07 httpd

       Here's a freshly started httpd who's served one request for the
same script using the CGI.pm function interface:

        TTY   PID USERNAME  PRI NI   SIZE   RES  STATE   TIME %WCPU
%CPU COMMAND
          p4  5036 dougm     154 20  3900K  2708K sleep   0:01  3.19
2.18 httpd

       Now do the math: take that difference, figure in how many other
scripts import the same functions and how many children you
       have running. It adds up!

Reply via email to