Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cs.utexas.edu!csd4.milw.wisc.edu!bionet!apple!well!wdh From: wdh@well.UUCP (Bill Hofmann) Newsgroups: comp.sys.mac.programmer Subject: Re: Quickdraw efficiency question Message-ID: <12676@well.UUCP> Date: 12 Jul 89 23:17:27 GMT References: <1681@neoucom.UUCP> <7943@hoptoad.uucp> Reply-To: wdh@well.UUCP (Bill Hofmann) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 17 In article <7943@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >In article <1681@neoucom.UUCP> sam@neoucom.UUCP (Scott A. Mason) writes: >>Question: >>Which would be faster when drawing multiple characters to a window? >> 1) repeated calls to DrawChar >> 2) building a string and calling DrawString. >DrawString. Smaller trap overhead, fewer internal calls to the Font >Manager, some built-in heuristics to speed things up. DrawText is >even better,m supposedly. Only by a few instructions for each call, since what DrawString does is pop the length byte and jump to the DrawText code. If efficiency is the object here, DrawText (or DrawString) is a very good candidate for doing a GetTrapAddress at the beginning of your application and doing a direct jump to it. I've clocked ~10% speed improvement in my app's redraw just from this optimization. -Bill