Profile help needed

Herbert König herbertkoenig at gmx.net
Sat Jun 3 12:23:12 UTC 2006


Hello Bob,


CBU> Is there anyone can give me some help with profiling.I have

there have been some discussions on this here. A search for the
subject containing "profile" and "profiling" will uncover something.

CBU> I used
CBU> TimeProfileBrowser and just kicked the rightmethod but I’m not
CBU> sure what it’s telling me except a lot is goingon.   

My rule of the thumb in profiling things with a GUI:
1- From the debug menu "start/browse MessageTally"
2- Keep the application busy via the UI for at least 10 seconds,
better more.

3- Ignore everything you don't understand. UI's spend a lot of time in
morpic event handling and display. This usually is the top of the list.

4- look at the ms written behind methods you wrote yourself and judge
if the times are acceptable.

5- Then use Time>>millisecondsToRun on what you found.

For example, if somewhere you find a message of yours and it says e.g.
35%, then 35% of the total time was spent there. Everything that is
indented below the message should add up to the 35%. These are the
messages sent from your message.

The whole thing seems to operate by periodically scanning the stack
and add up the times between scans for each method found on the stack.
(This is said by someone who doesn't understand Smalltalk's stack.)

This has some drawbacks, but Doug said there is a TimeProfileBrowser
page on the Swiki.

One annoying thing is the (not) indenting of too long lines. Doug Way
kindly hinted that on the class side of MessageTally there is a
message defaultMaxTabs and increasing this from 18 to e.g. 50 to 100
(depends on your screen) really improves things.

CBU> Also how do
CBU> I extract the data from that browser to post?

Often asked that myself and always ended up exporting the visible part
as a gif. Now I finally tried and didn't manage.

What I found is, the text pane is a PluggableListMorph whose list is
an OrderedCollection of strings. So if I need this really bad I would
code up some printContentsToFile and add it to the menu.

Cheers,


Herbert                            mailto:herbertkoenig at gmx.net




More information about the Squeak-dev mailing list