<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Oops... I had ran my tests to measure memory usage a few months ago and
didn't recall them correctly.&nbsp; I was off in my recollection.<br>
<br>
This is a snippet from Practical Mod Perl page 474 which does show
actual results.<br>
<br>
Example 13-13 cgi_oo.pl<br>
use CGI ()<br>
my $q = CGI-&gt;new;<br>
print $q-&gt;header();<br>
print $q-&gt;b("Hello");<br>
<br>
Example 13-14 cgi_proc.pl<br>
use CGI qw(header b);<br>
print header();<br>
print b("Hello");<br>
<br>
And then the memory usage is listed as 1966 bytes for 13-13 and 4710
for 13-14.&nbsp; This would seem to indicate it is a bit less than 2 KB per
symbol.<br>
<br>
So this module would likely only be important for mod_perl sites, or
large projects.&nbsp; With mod_perl, the symbols will likely be exported
into several different scripts.&nbsp; And also take up memory for all of the
mod_perl processes that are running.<br>
<br>
It seems like it will often save a bit of memory, and sometimes save a
great deal of memory.&nbsp; If this can be done without having to alter the
existing code other than importing another module, it seems like there
would be little reason not to use it.<br>
&nbsp; Dan<br>
<br>
<br>
Douglas Wilson wrote:
<blockquote cite="mid4526BA32.7040001@cox.net" type="cite">
  <pre wrap="">
Daniel Risse wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">unnecessary memory.  My tests showed about 100k for each symbol imported.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
100k? (you mean 100KB?)
Something is very wrong. I can't believe it takes that much for one
symbol. Or do you mean importing one symbol into many packages? And
how many imports would it take to add up to 100K?

Perhaps you're counting the memory required by Exporter?
That module will probably be required anyway by some dependency
of many non-trivial programs.

-Doug
_______________________________________________
San-Diego-pm mailing list
<a class="moz-txt-link-abbreviated" href="mailto:San-Diego-pm@pm.org">San-Diego-pm@pm.org</a>
<a class="moz-txt-link-freetext" href="http://mail.pm.org/mailman/listinfo/san-diego-pm">http://mail.pm.org/mailman/listinfo/san-diego-pm</a>

  </pre>
</blockquote>
</body>
</html>