On Thu, Feb 27, 2003 at 11:10:22AM -0500, Jeff Urlwin wrote:
> Tim,
> 
> There's probably a deeper timing issue on these that's causing the
> issues, but I thought I'd let you know:

> 1) The following fails on my machine:
>       t/40profile.t line 93
> 
>       ok($total > $longest);
> 
>       In this case, $total == $longest .. Not sure what the test is
> really trying to do or show or where it really is...but >= will "fix" it
> here...(or hide it)
> 
> Here's the output from Data::Dumper that leads to the problem.  If I
> read this correctly, the total time is also the same as the longest
> time...
> 
> bless( {
>   'Path' => [
>     '-2100000001'
>   ],
>   'Data' => {
>     '' => [
>       5,
>       '0',
>       '0',
>       '0',
>       '0',
>       '1046361110.89142',
>       '1046361110.90143'
>     ],
>     'select mode,size,name from ?' => [
>       40,
>       '0.0100140571594238',
>       '0',
>       '0',
>       '0.0100140571594238',
>       '1046361110.89142',
>       '1046361110.90143'      (took 0.01001 seconds)
>     ]
>   }
> }, 'DBI::Profile' )

Seems that either your 'high resolution time' isn't very high
resolution, or your machine is very fast :) I suspect the former.

What's your operating system? (and perl -V output?)
And, out of interest, what's the spec of your machine? (cpu/memory etc)

What does this say:
$ perl -MDBI=dbi_time -e '$a=dbi_time; 1 while (dbi_time eq $a); $a=dbi_time;++$c 
while (dbi_time eq $a); warn "$a\n$c\n".dbi_time'
1046365974.8218
1 
1046365974.82187
The 1 in the middle line is often missing, meaning that dbi_time
produces a different value faster than the loop loops.
If I change the "eq"'s to "==" then I can't even get a 1 to appear.

Also, try changing

! while ( my $hash = $sth->fetchrow_hashref ) {}
 
to

! for my $loop (1..100) {
!     $sth->execute(".");
!     while ( my $hash = $sth->fetchrow_hashref ) {}
! }

and see if it helps.



> 2) t/42prof_data.t test 6 ok($nodes->[0][4] < $longest);
> Fails.  Both values are 0.000000 here...until I change the test and add
> Data::Dumper prints between sorts and tests.

Uh. Why should Data::Dumper prints make a difference?

> Let me know if you want any more details/analysis.  This is a quick
> check

You could add a loop around the

  $sth->execute(".");
  $sth->fetchrow_hashref;
  $sth->finish;

so it does more work, and see if that helps.

Thanks.

Tim.

Reply via email to