Re: inline keyword and profiling

Chris Pickett <[email protected]> Sun, 06 Feb 2005 16:31:58 -0500
Newsgroups gmane.comp.java.vm.sablevm.devel
Message-ID <[email protected]>
Grzegorz B. Prokopski wrote:
> On Fri, 2005-04-02 at 19:27 -0500, Chris Pickett wrote:
> 
>>Chris Pickett wrote:
>>
>>>Hi,
>>>
>>>I was wondering: it seems the inline keyword might have an effect on 
>>>profiling.  Should we replace all inline's with svm_inline, just like we 
>>>now have svm_static?
>>
>>Actually man gcc says:
>>
>>-fno-inline
>>     Don't pay attention to the "inline" keyword.  Normally this option
>>     is used to keep the compiler from expanding any functions inline.
>>     Note that if you are not optimizing, no functions can be expanded
>>     inline.
>>
>>which I guess means there is no inlining with 
>>--enable-debugging-features (implies -O0).
> 
> 
> It depens on the kind of profiling you might want to do.  If you're
> profiling for time (and not ie. no. of events per program run) then
> profiling -O0 version is not very useful.
> 
> Having certain portions of the code inlined also makes difference in
> performance, not to mention that the "inline-threaded engine" will not
> work at all if you turn off inlining.
> 
> As for the original question - if there is a rationale why svm_inline
> should be introduced, then be it.  But it should be a good and verified
> rationale (ie. proven to be useful while used in a sandobx).

I think profiling with all debugging checks enabled and (by way of -O0) 
no inlining and no static methods is good enough to get all the low 
hanging fruit.  So, I still can't come up with a good reason for 
svm_inline.  Besides, you could still do -fno-inline if you wanted no 
inlining!

Improvements to the slowed-down version should translate to the sped-up 
version, at least partially, unless the optimizations being done by hand 
are things that -O2 or inlining would provide you with anyway.

Chris