salva has asked for the wisdom of the Perl Monks concerning the following question:
but unfortunately, Memchmark doesn't exist yet... so my question is: how can memory usage be measured?use Memchmark qw(cmpthese); my @data = 1..$ARGV[0]; cmpthese(-1, { foo => sub { my @out = foo(@data) }, bar => sub { my @out = bar(@data) } });
BTW, I don't need accurate numbers, an error around 25% could be admissible. I don't need it to be portable either, it should just work on Linux.
update: I have just uploaded Memchmark to CPAN.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "benchmarking" memory usage
by Zaxo (Archbishop) on May 30, 2005 at 19:54 UTC | |
|
Re: "benchmarking" memory usage
by dug (Chaplain) on May 30, 2005 at 19:56 UTC | |
|
Re: "benchmarking" memory usage
by mda2 (Hermit) on May 30, 2005 at 20:18 UTC | |
|
Re: "benchmarking" memory usage
by mirod (Canon) on May 30, 2005 at 21:09 UTC | |
by salva (Canon) on May 30, 2005 at 21:14 UTC | |
by Fletch (Bishop) on May 31, 2005 at 14:08 UTC | |
|
Re: "benchmarking" memory usage
by bofh_of_oz (Hermit) on May 30, 2005 at 20:22 UTC |