You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2001/09/18 18:16:18 UTC
cvs commit: modperl-2.0/util perl_bloat.pl
stas 01/09/18 09:16:18
Added: util perl_bloat.pl
Log:
adding a useful utility that reports how much bloat some perl code adds
Revision Changes Path
1.1 modperl-2.0/util/perl_bloat.pl
Index: perl_bloat.pl
===================================================================
#!/usr/bin/perl -w
use GTop ();
my $gtop = GTop->new;
my $before = $gtop->proc_mem($$)->size;
for (@ARGV) {
if (eval "require $_") {
eval {
$_->import;
};
}
else {
eval $_;
die $@ if $@;
}
}
my $after = $gtop->proc_mem($$)->size;
printf "@ARGV added %s\n", GTop::size_string($after - $before);