Too many questions :)

> -----Original Message-----
> From: Tim Bunce [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 27, 2003 12:25 PM
> To: Jeff Urlwin
> Cc: [EMAIL PROTECTED]
> Subject: Re: DBI 1.33 fail on Windows, ActiveState Perl 804 (5.8.0)
> 
> 
> 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.

My machine *is* pretty fast...

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

Windows XP service pack 1.
Pentium 4 (mobile), 2.2 Ghz
1 GB RAM

> 
> 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

I changed it to a separate script since I'm under windows and the
command shell is a pain, but I don't think I changed semantics on it:

use DBI qw(dbi_time);

my $a=dbi_time;
1 while (dbi_time == $a);
$a=dbi_time;
++$c while (dbi_time == $a);
warn "$a\n$c\n".dbi_time;

With eq 

1046367427.69059
1058
1046367427.7006


> 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.
> 

With ==

1046367479.27631
5547
1046367479.28632 at t.pl line 7.


> 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.
> 
> 
Just to be clear, I also pulled the execute() above the while into the
loop.

Yep -- did.  That 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?

Not sure and when re-running it, it's failing again -- with the
Data::Dumper data, so it must be that it's happening so fast (compared
to the timer resolution) that all the values are 0.000000.

> 
> > 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.

Ok -- very much better.  for $my (1..100) wrapped around it works here.

Jeff



Reply via email to