[comp.sys.mac.programmer] AppendMenu : Gack! Some results.

dudek@ai.toronto.edu (Gregory Dudek) (05/17/89)

   I'm the one who asked about speeding up AppendMenu.  Yes, as I
said in the original article, I know there are objections to huge menus.
BUT... I wanted one, or at least to try it out.  I must have gotten
at least as many flames as constructive letters.  You would have thought
I asked for a good recipe for poisoning babies with!

  Anyhow, David & Larry Rosenstien's suggestions were intelligent, but
don't work at all (at least on my Mac Plus running system 6.0.2) [Although
I never actually saw David's article, just references to it.]  It 
appears that what *really* slows down AppendMenu is *NOT* CalcMenuSize,
bit rather CountMItems!  Further, using a do-nothing defproc has no
effect on speeding things up -- it isn't called by AppendMenu.  

  AppendMenu CAN be greatly speeded up by using a short-term patch for
CountMItems.  That made a factor of 10 speed difference!
   Without patch, time in AppendMenu was 9.4 seconds to make a mega-menu.
   WITH patch, time in AppendMenu was 1.0 seconds to make a mega-menu.

   It's not at all clear to me how CountMItems could possibly be 
soooo sloooow for large menus, but it seems to be the case (it gets 
called once per addition, by the way, regardless of how many items 
are jammed in to one AppendMenu call).

  Rest easy flamers, I am not using these big menus after all.  I just wanted
check it out.  Thanks to those to made constructibe comments (even if they were
occasionally heated).
-- 
Dept. of Computer Science (vision group)    University of Toronto
Nice mailers:  dudek@ai.utoronto.ca
UUCP: {uunet,decvax,linus,pyramid,
		dalcs,watmath,garfield,ubc-vision,calgary}!utai!dudek
ARPA: user%ai.toronto.edu@relay.cs.net