Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!news.mathworks.com!tank.news.pipex.net!pipex!lade.news.pipex.net!pipex!mk2!
From: dpeachey@vmark.co.uk (Dan)
Subject: Re: I Need a Profiler for ENFIN Object Studio V4.00.1
Organization: VMark Software Ltd.
Date: Tue, 12 Mar 96 13:00:51 GMT
Message-ID: <1996Mar12.130051.3519@vmark.co.uk>
X-Newsreader: Forte Free Agent 1.0.82
References: <Do4Lv1.9r4@mtnlake.com>
Sender: @vmark.co.uk
Lines: 70

drew@mtnlake.com (Drew Atkins) wrote:


>I need a time-based profiler for ENFIN Object Studio.  The profiler
>that comes with ENFIN simply counts the number of times each message
>is sent, which is useless for figuring out where your software spends
>most of its time.  I would also appreciate any tips on building a
>time-base profiler for ENFIN Object Studio.

>Thanks, Drew Atkins

>Mountain Lake Software
>133 King Street East
>Third Floor
>Toronto, Ontario
>Canada, M5C 1G6

>Voice: 	(416) 863-8896
>Fax:	(416) 863-8989
>E-Mail:	drew@mtnlake.com


Hi Drew,

Here are some ideas for creating a time based profiler in Object
Studio:

1) What you need to do first is to set up a SendHook.  This is an
instance of BlockContext that is executed whenever there is a message
send.  To do this:

SendHooks at: #MyHook put: [:reciever :message :args | reciever out.
message out. args out.].

This will simply print out everything to the System Transcript when
run.

To get everything going:

System setSendHookTo: #MyHook.

You will notice all the info coming up on the transcript and that
everything is really slow. (since you are doing alot of extra
processing for each call).

To stop this:  System setSendHookTo: nil.

Now since you can set the BlockContext to do anything you like....

You could have a Transaction class,  that records all the info and
Time now.  If these were stored sequentially the time taken to perform
a method would be the difference between to sequential times
(obviously).  Once you have this list of data it would be fairly
simple to process it into something more presentable.  Note all the
times would not necessarily indicate true execution time (because of
extra processing) but would give an indication of relative execution
time.

Hope this helps.  If you have any more questions feel free to ask.  I
might try to have a look at this myself if I get the time.  If I get
anywhere with it I'll let you know.


Thanks

Dan.
Object Studio Support Analyst (VMark UK).

My opinions are my own.

