Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!usc!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: turning on a pixel Message-ID: <34169@apple.Apple.COM> Date: 21 Aug 89 04:35:42 GMT References: <6294@hubcap.clemson.edu> Organization: Apple Computer Inc, Cupertino, CA Lines: 38 In article <6294@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K O'Rourke) writes: >I am writing a graphics program that turns on many pixels one at a time >by calculating some mathematical eqns. (kind of a fractal). It presently >is using : > >moveto(x,y); >lineto(x,y); > >to turn on a pixel. Is there some quicker way to do this from pascal? I usually use PaintRect(r), where r is (x,y,x+1,y+1), just so I don't have to make 2 calls through the Dispatcher. I've also heard that MoveTo/Line(0,0) is particularly optimized, but I don't know if, internally, that's different from what you are doing. >The program is horribly slow right now and it needs to be speeded up. >For instance, does someone have a quick assembly routine that will turn >on a pixel? I'd be willing to convert to LSC so that i could use the >inline assembly if it would really improve speed. Do you know for sure that it's QuickDraw that's slowing you down? I was just working on a program that did a lot of intense calculations and single-pixel plotting. After my first pass at writing it (in MacApp, of course), I turned on the Performance tools to see where I could speed things up. *MUCH* to my surprise, almost no time was spent in QuickDraw. This was even after I was doing a lot of plotting, setting and changing of ports and gDevices, Color Manager calls, and region manipulations. It turned out that 85-90% of the time was spent in my calculations. Of course, this is just my own experience, and may not apply to yours. You may be plotting a bunch of X/Y pairs, and not be performing any calculations at all... ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions