Perl's profilers bite. I should know, I wrote one: Devel::Profiler. It's marginally better than the most common alternative, Devel::DProf, but it's very slow and breaks in many common scenarios. I've got an idea that might produce something better, but I want to get a reality check before I go and dump time into it.

I got the idea while reading an article about Intel's VTune profiler in Doctor Dobb's Journal. VTune works via an interupt handler which wakes up periodically and samples the instruction pointer of the process. These samples are used to construct a profile of the activity of the process. It's not a "perfect" profile in that it will miss things that happen infrequently or take very little time, but that's entirely acceptable in a profiler.

The up-side is that a sampling profiler like VTune is minimally invasive. It doesn't instrument the code being profiled and it can run so fast that it doesn't slow down the code being profiled. This means that the profiling data should be very reliable, corresponding closely to the behavior of the code when it's not being profiled.

So I started wondering what VTune-for-Perl would be like. Here's some random ideas:

Given the above, I have a few problems:

Help or pointers to RTFM on any of these topics would be greatly appreciated.

-sam

PS: Please don't suggest I use the Perl debugger (it's broken) or fix the Perl debugger (I can't and I think the only person that can is Ilya and he's too busy). If someone did fix the debugger I could just use Devel::DProf and it would probably be good enough. If you want to know what's wrong with the debugger, do a search on perl5-porters for bug-reports concerning seg-faults from Devel::DProf.


In reply to Dreaming of a Better Profiler by samtregar

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.