You have a variety of strategies available to you. Probably one of the most significant is to look at your actual queries and determine if you can optmize them by pushing all of a query into the owning class instead of allowing Class::DBI to span classes. This is a common and acceptable strategy. However, it does look like the bulk of your time is not spent on database access.

Right off the bat, we see that name_lc is taking a lot of time. That looks like a ridiculously large amount of time spent lower-casing a darned field name. Looking at the code, we see this:

use overload '""' => sub { shift->name_lc }, fallback => 1; + sub name_lc { lc shift->name }

We have one too many method calls. Eliminating the overload would be great, but if we can't, how about:

use overload '""' => sub { lc shift->name }, fallback => 1;

The only other place in the code that name_lc was being used was in Class/DBI.pm (and in only one spot). While it's nice to have a single point to lower-case the name, it's not as if we have exotic logic here, so if this solution seemed reasonable, perhaps submitting a patch to the Class::DBI list (assuming that you can demonstrate that this is a common case).

Still, I'd be concerned about these figures. The database is usually the bottleneck and that doesn't appear to be the case in your code.

Cheers,
Ovid

New address of my CGI Course.


In reply to Re: dprofpp -- now what? by Ovid
in thread dprofpp -- now what? by water

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.