I was working on some code and decided to give Memoize a shot since I had run out of ideas of how to make my application faster and was using Devel::Prof to help identify problem areas. The results were great, was I able to get it to run about 6 times faster than before!I was very happy however the last part I am having problems with is having to do with database queries.

Devel::Prof tells me what methods are taking my time and how many calls there are but it does not tell me where those calls are coming from. In this case, it is telling me that the database queries are taking most of the time now but not which ones. See below...

%Time Sec. #calls sec/call F name 13.88 9.5690 522901 0.000018 EEBL::get_field 12.40 8.5473 483 0.017696 DBI::st::execute 6.49 4.4764 186739 0.000024 EEBL::_get_object 4.15 2.8622 1760404 0.000002 Scalar::Util::refaddr 3.88 2.6735 2851 0.000938 DBI::db::do 2.16 1.4885 1726 0.000862 DBI::db::selectrow_array

The two things I would like to tackle are the number of calls to are being made to refaddr(which is being called from Class::Std ident function). Is there some what I can override the exported ident?

The second is tracing where the SQL calls that are being made for DBI::db::do and DBI::db::execute.

Help? Suggestions?


In reply to Profiling and Performance by Herkum

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.