Update: It was Filter::Indent::HereDoc which depends on Filter::Simple, which I believe depends on Text::Balanced. Took out F::I::H, re-indented all my HereDocs, and things fly. I am back in happy land, partially. I really do hate having to slide my HereDocs to the 0th column of the page instead of aligning neatly with the other prettily indented code. How do monks deal with this, if they do?

Thanks to BrowserUk's guidance, I got valuable mileage out of Devel::SmallProf. Fiddling around with various options, then going through the output, I have narrowed down the problem to Text::Balanced (see the top 8 worst perf hits below).

Text/Balanced.pm count wall tm cpu time line 47236 14.17731 13.93000 921: if (ref($func) eq 'CODE') 21983 7.933862 7.570000 952: if ($$textref =~ /\G(.)/gcs) 47236 1.307192 3.120000 918: $func = $func[$i]; 47236 1.252747 3.180000 930: if (defined($field) && length($field +)) 47236 1.168986 2.850000 919: $class = $class[$i]; 47236 1.068727 3.260000 920: $lastpos = pos $$textref; 47236 1.064919 3.290000 929: $pref ||= ""; 25253 1.048240 2.080000 915: foreach my $i ( 0..$#func )

Since I didn't directly call this module in use, obviously I am doing something that is calling its services. The modules I am using are --

I am also doing a bunch of regexp matching (does that call T::B?), but that seems to be very, very fast in the smallprof.out.

More guidance welcome. Where I am bringing in T::B? What can I do to avoid it, or to speed it.

Many thanks to everyone thus far.

--

when small people start casting long shadows, it is time to go to bed

In reply to Re: Finding bottlenecks in the code by punkish
in thread Finding bottlenecks in the code by punkish

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.