Well, you are right about the assert() call being wasteful. It's going to hit all of the subs that are in the top of your dprofpp output. However, if you really want to speed this up, you need to modify your approach your drastically than just removing that.

What you have here is really a join. Instead of doing multiple fetches, you could do one large fetch, and then construct your objects from it. Basically, I would do one query that pulls back all the columns you need from both tables (you could make this a custom SQL method of a Class::DBI object if you want to), and then feed the results to the construct() method on your classes. See the "QUICK RETRIEVAL" section of the Class::DBI docs for more on this.


In reply to Re: Re: Re: Re: Re: dprofpp -- now what? by perrin
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.