-----BEGIN PGP SIGNED MESSAGE----- Moin,
On Sunday 26 June 2005 14:32, Michael G Schwern wrote: > On Sun, Jun 26, 2005 at 01:58:26PM +0200, Tels wrote: > > (Including vars, because that gives us strict, vars, and warnings as > > a baseline): > > > > # ./perl -Ilib -Mvars -le 'print join ("\n", sort keys %INC); sleep > > (100)' strict.pm > > vars.pm > > warnings.pm > > warnings/register.pm > > Carp doesn't use any of this. Just Exporter. You are right, my bad. > schwern 12629 0.0 2.8 4048 1724 pts/0 S Jun21 0:00 perl > -MCarp -MCarp::Heavy -wle print join "\n", keys %INC; sleep 100 > > > I never was any good at interpreting ps output but it looks like > loading Carp on top of Exporter adds a grand total of 56K on my Debian > box (5.8.4). Carp::Heavy slugs in 208K plus another 132K of virtual > memory. Exporter weighs in at 204K + 140K virtual. > > I'd take the Exporter numbers with a grain of salt, its a very small > module. No where near the size of Carp::Heavy and shouldn't cost that > much memory. The above might be measuring some sort of first module > loaded cost. Have a look at loading strict vs strict + Exporter. > > schwern 12659 0.0 2.2 3784 1376 pts/0 S Jun21 0:00 perl > -Mstrict -wle print join "\n", keys %INC; sleep 100; schwern 12662 > 0.0 2.4 3916 1492 pts/0 S Jun21 0:00 perl -MExporter -Mstrict > -wle print join "\n", keys %INC; sleep 100; > > strict costs 120K + 8K vm. strict + Exporter is 236K + 140K vm. Note > that if we add the cost of strict alone with the cost of Exporter alone > the numbers don't jive with loading both of them together. It should > cost 324K + 148K vm, but it actually costs nearly 100K less. So > checking the cost of loading a module by subtracting the cost of > loading all its dependencies from the cost of loading the module might > not be accurate. See Dave's post about malloc granularity - that might explain a few things. So, in conclusion, I think it is worthwhile to apply these changes, because: * no matter how you measure it, memory consumption goes down * the changes are small and pure-perl only Does anybody disagree with me? Best wishes, Tels - -- Signed on Sun Jun 26 15:12:05 2005 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email. "online porn is the most concerning thing to psychological health that I know of existing today." -- Mary Anne Layden in ttp://tinyurl.com/6a9cy (I fear what she will say about violence in computer games, evening news or Hollywood block-busters...) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iQEVAwUBQr6qxXcLPEOTuEwVAQEzswf7B9rfG4+3ip3qGc3XCaMFy/4fNniZuV6I Q+SfEMRanjJWf86pgjHmW6qYJtTmT7fHVwXzfjqnZBcw2UNMp4vK21stPIgYZSaK mYcD+hMqghdrlO9P863YYwQ7Q5Igp2pOGjZCsGR0j9Sb0Gr2v/9O33VZiQoFB5DZ wvliZyVdrcnxtd7SBTANdjMk+TOcah640warwZ3sV/FBrZqxedO295eCl0lyfPWS GQh4JFoCO+li2k6xcB8wqQ5BmiAybtPx5rskwCSV2fq2ioPRGsKPQroE+wDa08oc edo3rkwe4ppINgKwMDzZQ8BNucX9cdsBqK6Jvm91Rds0Cc43gcBTnQ== =p4nh -----END PGP SIGNATURE-----