Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Speeding up MacApp programs Message-ID: <51346@apple.Apple.COM> Date: 9 Apr 91 18:23:12 GMT References: <1991Apr8.101436.11202@runx.oz.au> <1991Apr8.203216.16764@ux1.cso.uiuc.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 46 In article <1991Apr8.203216.16764@ux1.cso.uiuc.edu> ml27192@uxa.cso.uiuc.edu (Mark Lanett) writes: > >I don't pay much attention to speed, but even on an FX it's obvious that Apple >it lying when it claims that MacApp programs aren't slower. MacApp spends a >lot of time just running through its command chain. It's not that it's >object-oriented, but that the hierarchy of objects -- especially view objects >-- causes it to have to make _lots_ of calls just to resize a window. No, I don't think that Apple is lying when we claim that MacApp programs aren't slower. A properly written MacApp program runs just fine. It's just that with any large, complex system -- such as MacApp -- you have to keep optimization issues in mind. There's a reason why MacApp is so large: it does a lot. If a program does a lot, it will naturaly take a long time to do it. The trick is to make sure that you don't require MacApp to do everything it can do every time through your main event loop. Resizing a window is a good example of putting MacApp through its paces. In a complex windows, each view has to get a crack at what it needs to to. Doing a full traversal of the views will take a while. (This will be better in MacApp 3.0, by the way). However, you aren't resizing your windows every time through the main event loop, so that aspect of MacApp shouldn't be slowing down your program. And if you stay away from things like full view traversals where you have to call TView.Focus on each view, you should be fine. Most of MacApp's code deals with user interface issues. As such, it percentage of execution is only about 10-20% of any complex program. If you reduce this percentage, and/or concentrate on the other 80-90%, then you'll probably starts to get the big wins. >I concentrate on user-interface design to achieve speed-ups; i.e. if you have >some search that uses a modal dialog box, making it modeless will appear to >speed things for the user more than a faster search would (most of the time); >using popup menus instead of dialog boxes altogether is one of the best ways. Good point. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "But where the senses fail us, reason must step in." - Galileo