In all probability, you're right. I'm trying to design a hack for a hack for a hack (or something along those lines) and I'm being stubborn and insolent by proceeding along this thought line. :-)

However, I should point out that the DBI author describes a 1:4 decrease in performance when switching from fetch (binded columns) to fetchrow_array. I'm not sure where fetchrow_hashref sits in relation to fetchrow_array, but I don't doubt it's as-bad or worse.

On the other hand, he also says that this is due to the limitations of Perl and how it handles memory, and not because of DBI or the database engine. So it's doubtful that this method will gain anything over fetchrow_hashref, as you said. But maybe it's work checking out.

I have no qualms about writing $a::name instead of $a->{name} if it's four (or even two) times faster. This also deserves to be compared to a standard bind_columns routine, and the fetchrow_arrayref ($a->[0]) method. There's very little doubt in my mind that bind_columns is fastest, followed by arrayref, hashref, then array. I'm just curious to see where this technique fits in, and if it can be adapted to increase A) readability in situations where fetchrow_arrayref is being used, and B) speed in situations where fethrow_hashref is being used.

<goes to dust of the ol' test tubes>

Alakaboo


In reply to RE: (2) (Package Data) RE: (3) You can't get there from here.... by mwp
in thread References of Eternal Peril by mwp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.