Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: DBI Style Inquiry

by Tux (Canon)
on Jun 28, 2013 at 12:42 UTC ( [id://1041243]=note: print w/replies, xml ) Need Help??


in reply to Re^3: DBI Style Inquiry
in thread DBI Style Inquiry

The difference between BC and DBC is the method-call overhead. If you really want to squeze out nonoseconds per call, it matters. It is not something I would propagate in use though:

Create table 5000 x 12 Dbindcol 660153.156 recs/sec 4.8 x faster DBC bindcol 633472.697 recs/sec 4.6 x faster BC Darrayref 563380.282 recs/sec 4.1 x faster DAR arrayref 525486.075 recs/sec 3.8 x faster AR array 227086.929 recs/sec 1.7 x faster A hashref 136836.344 recs/sec HR
{ $sth->execute; my ($n, $now) = (0, [ gettimeofday ]); while (my $ref = $sth->fetchrow_hashref) { ++$n % 100 == 0 and printf " %6d\r", $n; } report ("hashref", $n, $now); } { $sth->execute; my ($n, $now) = (0, [ gettimeofday ]); while (my @row = $sth->fetchrow_array) { ++$n % 100 == 0 and printf " %6d\r", $n; } report ("array", $n, $now); } { $sth->execute; my ($n, $now) = (0, [ gettimeofday ]); while (my $ref = $sth->fetchrow_arrayref) { ++$n % 100 == 0 and printf " %6d\r", $n; } report ("arrayref", $n, $now); } { $sth->execute; my ($n, $now) = (0, [ gettimeofday ]); while (my $ref = DBI::st::fetchrow_arrayref ($sth)) { ++$n % 100 == 0 and printf " %6d\r", $n; } report ("Darrayref", $n, $now); } my %ref; { $sth->execute; $sth->bind_columns (\(@ref{@{$sth->{NAME_lc}}})); my ($n, $now) = (0, [ gettimeofday ]); while ($sth->fetch) { ++$n % 100 == 0 and printf " %6d\r", $n; } report ("bindcol", $n, $now); } { $sth->execute; $sth->bind_columns (\(@ref{@{$sth->{NAME_lc}}})); my ($n, $now) = (0, [ gettimeofday ]); while (DBI::st::fetchrow_arrayref ($sth)) { ++$n % 100 == 0 and printf " %6d\r", $n; } report ("Dbindcol", $n, $now); }

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1041243]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-19 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found