View mode: basic / threaded / horizontal-split · Log in · Help
March 30, 2007
More granular performance profiling?
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?
March 30, 2007
Re: More granular performance profiling?
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.
March 30, 2007
Re: More granular performance profiling?
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
March 30, 2007
Re: More granular performance profiling?
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.
March 30, 2007
Re: More granular performance profiling?
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 :)
March 30, 2007
Re: More granular performance profiling?
"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 :)
April 01, 2007
Re: More granular performance profiling?
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!!! :-))))
Top | Discussion index | About this forum | D home