Tim - You are the man.  On small documentation note - you may want to
change the POD to reflect the more speedy DBI::PurePerl.

### CUT

=head2 Speed.  Speed.  Speed.  Did we mention speed?

DBI::PurePerl is slower. Although, with some drivers in some
contexts this may not be very significant for you.

By way of example... the test.pl script in the DBI source
distribution has a simple benchmark that just does:

    my $null_dbh = DBI->connect('dbi:NullP:','','');
    my $i = 10_000;
    $null_dbh->prepare('') while $i--;

In other words just prepares a statement, creating and destroying
a statement handle, over and over again.  Using the real DBI this
runs at ~4550 handles per second but DBI::PurePerl can only manage
~230 per second on the same machine.

I'm sure we can improve the performance with more work, but we'll
be lucky to more than double it.

### CUT

Maybe such a harsh warning is no longer necessary.  Did I mention you
are the man?


 
Nick Hendler
[EMAIL PROTECTED]

_________________________________________

From:    Tim Bunce <[EMAIL PROTECTED]>
Date:    Friday, May 24, 2002 
Time:    11:40:16 AM
Subject: DBI::PurePerl performance

On Tue, May 21, 2002 at 12:41:47AM +0100, Tim Bunce wrote:
> FYI, I've added this to the DBI::PurePerl docs:
> 
>     By way of example... the test.pl script in the DBI source
>     distribution has a simple benchmark that just does:
>      
>       my $null_dbh = DBI->connect('dbi:NullP:','','');
>       my $i = 10_000;
>       $null_dbh->prepare('') while $i--;
>      
>     In other words just prepares a statement, creating and destroying
>     a statement handle, over and over again.  Using the real DBI the loop
>     runs at ~4550 handles per second but DBI::PurePerl can only manage
>     ~230 per second on the same machine.
>      
>     I'm sure we can improve the performance with more work, but we'll
>     be lucky to more than double it.
> 
> When I first wrote that a couple of hours ago it said ~150 per second.
> 
> There are a few more things I can do to speed it up but I still think
> "we'll be lucky to more than double it".

Okay, either I lied or we are lucky.

I've been doing some surgery on it and introduced the inner/outer
handle concept (using $inner = tied %$outer) and that, along with
some other changes has raised the performance of the prepare loop
from 230/sec to 2310/sec! Mainly by avoiding a bazillion calls to
FETCH to get attribute values.

DBI::PurePerl is also now a rather more accurate emulation of the
DBI than it was.

Overall this means DBI::PurePerl is now a very viable solution for
users of pure-perl drivers.

I've attached the new version and I'd be very grateful if authors
of pure-perl drivers could test it against their drivers.

Thanks.

Tim.

p.s. There does seem to be a problem with running the proxy tests
(for DBD::Proxy and DBI::ProxyServer) which need looking into
before a release.

Reply via email to