New sub-profiler Branch

Christoph Otto christoph at
Fri Sep 2 21:22:23 UTC 2011

On Fri, 02 Sep 2011 21:17 +0200, "Michael Schroeder" <mls at>
> Hi Parrot-Dev,
> cotto asked me to write a bit about the sub-profiler branch.
> Some background: I wrote it to profile Rakudo's setting compilation.
> I first tried parrot's current profiling support, but found
> out that it slowes down parrot too much, as it writes a line
> for every op and every context change instead of incrementing
> internal counters.
> So I hacked together my own little profiling runcore. It directly
> writes kcachegrind ready data to stderr. Instead of doing it
> right I patched the "slow" runcore, so "-R slow" will turn on
> profiling.
> It curently both counts ops and ticks, for ticks it uses
> the hardware-dependant Intel/Amd Time Stamp Counter.
> I spent a bit of time to get the callcontext changes right, so
> it should handle exceptions/continuations/tailcalls.
> The code wasn't meant to be seen by the public in the current
> state, so please be kind. I got pressurized to release it so
> early ;-)
> Enjoy,
>   Michael.

Thanks for contributing!

The code is ugly now, but it serves nicely as a first approximation and
a proof-of-concept.  I'm working on getting the code up to Parrot
standards in the mls/sub-profiler branch.  If I can, I'll steal the
bits that make sense and make them the default for the profiling
runcore.  If not, I (and whoever's interested) will make the sub
profiler suitable for use as an alternate runcore.  All are welcome to
jump in (especially mls).


More information about the parrot-dev mailing list