> 
> I got some interesting results with this benchmark that I'd 
> like some help interpreting.  This test is on a Windoze XP 
> box comparing:
> 
>    ora_odbc_driver (Oracle supplied(?) ODBC driver)
>    ms_odbc_driver  (Microsoft supplied ODBC driver)
>    ora_dbd_driver   (DBD::Oracle)
> 
> Here is my test script:

[script snipped]
> 
> Here are the results:
> 
> Benchmark: timing 100 iterations of ms_odbc_driver, 
> ora_dbd_driver, ora_odbc_dri ver...
> ms_odbc_driver: 35 wallclock secs ( 2.15 usr +  4.05 sys =  
> 6.21 CPU) @ 16.11/s
> (n=100)
> ora_dbd_driver: 124 wallclock secs ( 1.44 usr +  2.89 sys =  
> 4.34 CPU) @ 23.06/s
>  (n=100)
> ora_odbc_driver: 262 wallclock secs ( 3.46 usr +  4.91 sys =  
> 8.37 CPU) @ 11.94/ s (n=100)
>                   Rate ora_odbc_driver  ms_odbc_driver  ora_dbd_driver
> ora_odbc_driver 11.9/s              --            -27%            -48%
> ms_odbc_driver  16.3/s             37%              --            -29%
> ora_dbd_driver  22.8/s             92%             40%              --
> 
> -----------------------------------
> 
> Ok I'm having a brain-fart - can someone clue me in as to how 
> to read this last section that compares the different methods 
> using percentages?  Is the 1st column saying that 
> ms_odbc_driver is 37% faster than the ora_odbc_driver, and 
> the ora_dbd_driver(DBD::Oracle) is 92% faster than the 
> ora_odbc_driver??  The last 2 columns have me confused too.  
> Any help is appreciated.


Ok -- First, let me comment on the "test".  I understand that connection
times are important, but only testing drivers speed based upon
connection/disconnection time is probably not a good test and results may
vary wildly...  I *do* have a hard time I believe that the Oracle ODBC
driver is *slower* that DBD::Oracle.

I updated your script, made it a bit more generic and added my ODBC drivers
in, I get strange results like yours above.  From my results, I don't
believe the cmpthese function is correct -- and is sadly broken.  Here's
what I show, using a local Oracle database, ACCESS, a remote SQLServer
(which always has a fast connection) and a sadly underperforming DB2 server
(remote also).  The SQLServer and DB2 server are both on 100MBit switched
connections to my machine.


Benchmark: timing 100 iterations of DBD_ODBC_ACCESS, DBD_ODBC_DB2,
DBD_ODBC_MSORACLE, DBD_ODBC_ORACLE, DBD_ODBC_SQLSERVER, DBD_ORACLE...

DBD_ODBC_ACCESS:  7 wallclock secs ( 0.82 usr +  1.11 sys =  1.93 CPU) @
51.76/s (n=100)
DBD_ODBC_DB2: 64 wallclock secs ( 0.75 usr +  0.63 sys =  1.38 CPU) @
72.36/s (n=100)
DBD_ODBC_MSORACLE:  7 wallclock secs ( 1.54 usr +  1.15 sys =  2.69 CPU) @
37.12/s (n=100)
DBD_ODBC_ORACLE:  5 wallclock secs ( 1.82 usr +  1.26 sys =  3.08 CPU) @
32.41/s (n=100)
DBD_ODBC_SQLSERVER:  6 wallclock secs ( 1.04 usr +  0.90 sys =  1.94 CPU) @
51.49/s (n=100)
DBD_ORACLE:  4 wallclock secs ( 1.07 usr +  0.67 sys =  1.74 CPU) @ 57.37/s
(n=100)

                     Rate DBD_ODBC_ORACLE DBD_ODBC_MSORACLE DBD_ORACLE
DBD_ODBC_ACCESS DBD_ODBC_SQLSERVER DBD_ODBC_DB2
DBD_ODBC_ORACLE    32.1/s              --              -27%       -40%  -51%
-53%         -75%
DBD_ODBC_MSORACLE  43.8/s             37%                --       -18%  -34%
-35%         -65%
DBD_ORACLE         53.7/s             67%               22%         --  -19%
-21%         -57%
DBD_ODBC_ACCESS    66.1/s            106%               51%        23%    --
-3%         -48%
DBD_ODBC_SQLSERVER 67.9/s            112%               55%        27%    3%
--         -46%
DBD_ODBC_DB2        126/s            293%              188%       135%   91%
86%           --

>From the results you have and I have, cmpthese seems broken -- or is
*definitely* not correct on Win32 because it's using usr and sys time, not
wallclock time.  (I guess that depends upon your perspective of "broken" --
maybe just "broken on Win32 would be more correct, until proven otherwise).

Also note, timethese is sadly reporting that I can perform 72.36 connections
per second using DB2, even though 100 connections took more than a one
minute...

Also, for reference, my script (which will be in the subversion repository
by the time you read this) is:
-----------
#!perl -w

use strict;
use DBI;
use Benchmark qw(timethese cmpthese timeit countit timestr);

my %conns = (
             DBD_ORACLE => sub { doconnect("dbi:Oracle:URLWINLT"); },
             DBD_ODBC_ORACLE => sub {
doconnect("dbi:ODBC:PERL_TEST_ORACLE"); },
             DBD_ODBC_MSORACLE => sub {
doconnect("dbi:ODBC:PERL_TEST_MSORACLE"); },
             DBD_ODBC_SQLSERVER => sub {
doconnect("dbi:ODBC:PERL_TEST_SQLSERVER"); },
             DBD_ODBC_DB2 => sub { doconnect("dbi:ODBC:PERL_TEST_DB2"); },
             DBD_ODBC_ACCESS => sub {
doconnect("dbi:ODBC:PERL_TEST_ACCESS"); },
            );

sub doconnect ($) {
   my $connstr = shift;
   my $dbh = DBI->connect($connstr,
                          $ENV{DBI_USER},
                          $ENV{DBI_PASS},
                          { RaiseError => 1, PrintError => 1 }
   ) || die "Can't connect with $connstr: $DBI::errstr";
}

timethese 100, \%conns;
cmpthese 100, \%conns;

---------

Regards,

Jeff








Reply via email to