Re: Devel::SmallProf claims "return 1" needs much time !?
- From: Wolfram Humann <w.c.humann@xxxxxxxx>
- Date: Wed, 30 Apr 2008 13:06:24 -0700 (PDT)
On Apr 30, 6:38 pm, xhos...@xxxxxxxxx wrote:
This just seems weird. My 3GHz machine does an if defined test 32 times
faster, so unless you have an old computer I would say that this casts
doubt on the entire reliability of the SmallProf output.
I think you got somthing wrong here. The profiler runs on the comiled
and optimized code where several source-lines may have become one. If
you look at the "count"-column, you will see that line 110 includes
the time for seek() in the next line. Im my experience, the shortest-
running lines in a script (e.g. "my $self = shift;") will indeed vary
a lot from run to run because of the nulltime-compensation im
SmallProf. The lines we're talking about are fairly stable.
If you can post the entire harness (provided it is small) you are using to
profile DBM::Deep, I'll play with it a bit.
Every script that imports heavily in DBM::Deep will do. Mine looks
like this:
BEGIN
{
$DB::profile = 0;
%DB::packages = ( 'DBM::Deep::Engine' => 1,
'DBM::Deep::Engine::Sector' => 1, 'DBM::Deep::File' => 1 );
}
use strict;
use warnings;
use DBM::Deep;
my $text = 'this is always the same dummy text';
my $inner = 500;
my $outer = 2;
my $profilefile = "prof.out";
my $db = DBM::Deep->new( "deeptest2.db" );
for my $j (1..$outer)
{
my $data;
for my $i (1..$inner)
{
my %hash = map { +"subkey$_" => $text } (12..30);
$data->{"key$i"} = \%hash;
}
$DB::profile = 1 if $j == $outer;
my $t = time();
$db->import($data);
print "Import duration: ", time() - $t, "\n";
}
But I can't say exactly how $inner and $outer were set when I created
the posted profile. Also, I already did some changes in DBM::Deep that
might affect performance.
Wolfram
.
- Follow-Ups:
- References:
- Devel::SmallProf claims "return 1" needs much time !?
- From: whumann
- Re: Devel::SmallProf claims "return 1" needs much time !?
- From: xhoster
- Devel::SmallProf claims "return 1" needs much time !?
- Prev by Date: Re: use perl to draw Venn Diagram
- Next by Date: Re: Devel::SmallProf claims "return 1" needs much time !?
- Previous by thread: Re: Devel::SmallProf claims "return 1" needs much time !?
- Next by thread: Re: Devel::SmallProf claims "return 1" needs much time !?
- Index(es):
Relevant Pages
|
|