I'd like to profile some code (the MiniD interpreter to be exact), but the -profile flag for DMD only profiles down to the function level. This obviously doesn't help much when considering that the interpreter is basically one big function with a while loop in it.
Short of splitting the interpreter function into several smaller functions to profile it, is there any way to get more granular performance profiling? A library or such?

Jarrett Billingsley wrote:
> I'd like to profile some code (the MiniD interpreter to be exact), but the -profile flag for DMD only profiles down to the function level. This obviously doesn't help much when considering that the interpreter is basically one big function with a while loop in it.
> > Short of splitting the interpreter function into several smaller functions to profile it, is there any way to get more granular performance profiling? A library or such?
>
In case you haven't already used it, -cov will give you hit counts for each line. (I find -cov to be the best debugging and profiling tool ever devised -- the unit test coverage aspect is a minor additional benefit <g>). Might not be what you need, though.

Jarrett Billingsley wrote:
> Short of splitting the interpreter function into several smaller functions to profile it, is there any way to get more granular performance profiling?
Don't you mean less granular?
Does more or less make much sense for granular, anyway?
But as I understand, you want smaller granules, which I
think makes it less granular..... :)
Happy granning, 0ffh

Jarrett Billingsley wrote:
> I'd like to profile some code (the MiniD interpreter to be exact), but the -profile flag for DMD only profiles down to the function level. This obviously doesn't help much when considering that the interpreter is basically one big function with a while loop in it.
> > Short of splitting the interpreter function into several smaller functions to profile it, is there any way to get more granular performance profiling? A library or such?
> >
std.perf is pretty easy to work with and has a high performance counter.

0ffh wrote:
> Jarrett Billingsley wrote:
>> Short of splitting the interpreter function into several smaller functions to profile it, is there any way to get more granular performance profiling?
> > Don't you mean less granular?
> Does more or less make much sense for granular, anyway?
> But as I understand, you want smaller granules, which I
> think makes it less granular..... :)
> > Happy granning, 0ffh
>
Think of "more granular" as breaking something up into more granules. "more" and "less" refer to the number of granules, not the size of them :)

"Jarrett Billingsley" <kb3ctd2@yahoo.com> wrote in message news:euhvka$104t$1@digitalmars.com...> I'd like to profile some code (the MiniD interpreter to be exact), but the -profile flag for DMD only profiles down to the function level. This obviously doesn't help much when considering that the interpreter is basically one big function with a while loop in it.
>> Short of splitting the interpreter function into several smaller functions to profile it, is there any way to get more granular performance profiling? A library or such?
>
Thanks for the suggestions. I think I'll derive HighPerformanceCounter and add some goodies to it :)

Mike Parker wrote:
> Think of "more granular" as breaking something up into more granules. "more" and "less" refer to the number of granules, not the size of them :)
So the continouse case is also the most discrete one?
Finally it all makes sense.... my math teacher hated me!!! :-))))