www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - More granular performance profiling?

reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
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? 
Mar 29 2007
next sibling parent Don Clugston <dac nospam.com.au> writes:
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.
Mar 30 2007
prev sibling next sibling parent reply 0ffh <spam frankhirsch.net> writes:
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
Mar 30 2007
parent reply Mike Parker <aldacron71 yahoo.com> writes:
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 :)
Mar 30 2007
parent 0ffh <spam frankhirsch.net> writes:
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!!! :-))))
Apr 01 2007
prev sibling next sibling parent Lutger <lutger.blijdestijn gmail.com> writes:
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.
Mar 30 2007
prev sibling parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"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 :)
Mar 30 2007