Ian: Suggestion for your Profiler...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Ian: Suggestion for your Profiler...

Christopher J. Demers
Ian, I was using your Sampling Stack Profiler, Version5c - April 2004 a few
weeks ago to profile some operations with a ReStore object relational
mapper.  I ran into some problems with ReStore's proxies while profiling.
So I made some minor changes to the profiler code to be more tolerant of
proxies.  Essentially I think I just replaced class with basicClass.  After
I made those changes the profiler worked great.  Thanks for another awesome
tool.

The changed methods are bellow.  If you can't think of any negative side
effects you may want to consider integrating them into the profiler as it
seems to handle proxies better.

Chris
=============
!ProfilerFrame methodsFor!
isSameFrameAs: aStackFrame
"Answers true if the receiver represents the same evaluation point as
anIProfilerSampleFrame.
CompiledCode>>= causes quite a performance hit so only use it for blocks.
Note that
we base the comparison on the receiverClass and not the methodClass"
"cdemers - 9/27/2004 Changed to use basicClass to better handle proxies."
isBlock
ifTrue: [compiledCode = aStackFrame method ifFalse: [^false]]
ifFalse:
[(receiverClass = aStackFrame receiver basicClass and: [selector =
aStackFrame method selector])
ifFalse: [^false]].
^ip = aStackFrame ip! !
!ProfilerFrame categoriesFor: #isSameFrameAs:!public!testing! !
!ProfilerFrame methodsFor!
setFrame: aStackFrame
"Initialize the receiver from aStackFrame"
"cdemers - 9/27/2004 CHnaged to basic class to better handle Proxies."
compiledCode := aStackFrame method.
methodClass := compiledCode methodClass.
receiverClass := aStackFrame receiver basicClass.
selector := compiledCode selector.
ip := aStackFrame ip.
isBlock := aStackFrame isKindOf: BlockFrame.
^self! !
!ProfilerFrame categoriesFor: #setFrame:!initializing!public! !
===============


Reply | Threaded
Open this post in threaded view
|

Re: Ian: Suggestion for your Profiler...

Schwab,Wilhelm K
Chris, Ian,

> The changed methods are bellow.  If you can't think of any negative side
> effects you may want to consider integrating them into the profiler as it
> seems to handle proxies better.

If you are at all concerned, you could add a replaceable policy to make
the decisions.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Suggestion for your Profiler...

Ian Bartholomew-19
In reply to this post by Christopher J. Demers
Chris,

> The changed methods are bellow.  If you can't think of any negative
> side effects you may want to consider integrating them into the
> profiler as it seems to handle proxies better.

Thanks.  I'll have a look at the Profiler (to remind myself how it works)
and incorporate your changes.

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.