I've never used Class::DBI, but a quick look shows that the code for Class::DBI::Column is very simple. It might be worth hacking it to cache the lower-case version of the classname to see if that makes a difference:

use overload '""' => sub { shift->{'name_lc'} }, fallback => 1; [...] sub new { my ($class, $name) = @_; return $class->SUPER::new( { name => $name, name_lc => lc($name), _groups => {}, placeholder => '?' } ); } sub name_lc { shift->{'name_lc'} }

That should save quite a chunk from the first two lines of your profile output:

%Time Sec. #calls sec/call F name 14.67 55.4872 2174052 0.000026 <anon>:...5.8.2/Class/DBI/Colu +mn.pm:37 9.55 36.1474 2178574 0.000017 Class::DBI::Column::name_lc

Be careful though if any other classes are inheriting from CDBI::Column - you'd need to check that this hack is compatible with their expectations. (I'd expect it to be ok though, as long as inheritors call their SUPER::new() to construct.)

Hugo


In reply to Re: Using Devel::Profile output to know what to do next by hv
in thread Using Devel::Profile output to know what to do next 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.