Tetris

Scott Wallace Scott.Wallace at disney.com
Wed Dec 1 05:46:34 UTC 1999


Michael,

The "spy" (MessageTally) is exactly the tool you need for this, and 
it is a wonderful tool that will quickly become a trusted and 
essential ally.

I'm sure you'll get other responses to your request, so I won't go 
into great detail, except to suggest that you try the following:

*  Make certain you have no other morphic windows open which might be
         competing for cpu time.
*  Start up a Tetris game.
*  Go to the world's debug menu and choose "start Message Tally".
*  Click "yes" on the ensuing dialog to start.
*  Play Tetris for a while -- say a minute or so.
*  Move the cursor to the top of the screen to end the spying session.
*  You'll get a very useful printout in a window.
*  "Hot Spots" may leap out at you from either the tree, the leaves or both.

If you search the squeak archive (and perhaps the squeak swiki) for 
"MessageTally" you'll find several entries concerning MessageTally 
and how to interpret its results.

Hope this helps.

   -- Scott

PS:  When I ran MessageTally on Tetris just now, I found that 83% of 
the time was spent in Delay.wait (for interCycle pauses), so it 
appears to me that this game is *not* compute-bound!  I wonder if you 
perhaps had some other windows open on your screen that were sucking 
up cpu time ubeknownst to you.  Possible thirsty culprits include a 
Preferences window, or any browser looking at an 'all' category.

PPS: So sorry about your iBook's HD crash.  Setting aside its having 
swallowed all your bits, how is it otherwise?  How nice as a squeak 
machine?


At 10:53 PM -0600 11/30/99, Michael Donegan wrote:
>I got interested in the Tetris game a few weeks ago and spent a lot of time
>cleaning it up and trying to solve the problem that its performance
>degrades as the number of blocks increases. My "optimization" didn't help
>all that much, so now I'm kinda interested in how one goes about profiling
>and tweaking Morphic code. I'm thinking that it is a Morphic problem. But I
>don't have much of a clue.
>
>Also, unfortunately, the brand new hard disk on my iBook croaked and Apple
>graciously replaced it along with all my bits so I don't have the fine
>cleaned-up version that I had before.
>
>But, before going back and doing it again, I was wondering if anyone would
>like to do a tutorial on how to go about finding the hot spots in something
>like this.
>
>Has anyone else looked at this problem?
>
>	mkd





More information about the Squeak-dev mailing list