i'll be the first to admin that i'm just spouting off here....
a perl profiler would quickly reveal where the time is really being
spent.

> > I don't know if things have improved in the past few years, but about three
> > years ago I had to tune some bulk loading of a perl object cache from an
> > RDBMS, and found that fetchrow_arrayref was about 5 times faster. I also 
> > found
> > that if I implemented the semantics of fetchrow_hashref myself, it was twice
> > as fast as whatever it is DBI is doing.
> 
> Have you benched it recently?

no.

> > It seems consistent with the RDBO benchmark results, where the cases where
> > fetchall_arrayref are used (simple iteration), the disparity is greatest.
> 
> Cases where fetchall_arrayref() is used by what?  By the plain DBI tests?

i spoke too soon.
i see now that the "search" DBI tests are using fetchall_array
and the "iterate" DBI tests are using bind_columns + fetch.

in my experience, basically any alternative to fetch*_hashref is
noticeably faster, and among those alternatives, they are all
pretty similar.
not too surprisingly, if you fill a reusable $row hash using
bind_columns
and then fetch, it ends up no different than bind_columns on an array,
or fetchrow_arrayref.

> > Is it really the case that use of fetchrow_arrayref has to
> > interfere with the  programmer interface?
> > In particular, is there some way for Rose::DB::Object::Loader
> > to do whatever mysto-spooko magic that "use fields" offers?
> 
> Loader just automates what you could have done manually.  if you're
> asking
> whether or not RDBO can (or should) use pseudo hashes, the answer on both
> counts is "no", IMO.

well if not pseudo hashes, then restricted hashes, or Class::Struct, or
anything that puts a friendly face on array indexes.
some of those techniques require "compile time" access to work --
it is not clear to me that it really is the case that Loader can
do everything I could do manually.
my knowledge of the perl internals in that area is somewhat dated.


-mda


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to