Profile help needed

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

Profile help needed

Bob.Cowdery

Is there anyone can give me some help with profiling. I have a composite morph where I can scroll a 9 digit frequency up and down with the mouse wheel. Now, maybe I implemented it badly but when I scroll fast it take oodles of CPU. I used TimeProfileBrowser and just kicked the right method but I’m not sure what it’s telling me except a lot is going on.   Also how do I extract the data from that browser to post?

 

Thanks

Bob

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.



Reply | Threaded
Open this post in threaded view
|

Re: Profile help needed

Herbert König
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:[hidden email]