Re: Devel::SmallProf claims "return 1" needs much time !?



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
.



Relevant Pages

  • Re: Devel::SmallProf claims "return 1" needs much time !?
    ... I often find SmallProf to be unreliable, especially when trying to profile ... code portions which are fast on each execution but are executed very often. ... doubt on the entire reliability of the SmallProf output. ... suppose disc caches work their wonders...). ...
    (comp.lang.perl.misc)
  • Re: Coker Rim
    ... If that 60g is at the outer section, ... such things as changing to a 60g lighter tube, ... unisk8r's Profile: http://www.unicyclist.com/profile/4660 ...
    (rec.sport.unicycling)