home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22039 < prev    next >
Encoding:
Text File  |  1993-01-24  |  2.3 KB  |  56 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!mcsun!sunic!kth.se!cyklop.nada.kth.se!d88-jwa
  3. From: d88-jwa@cyklop.nada.kth.se (Jon WΣtte)
  4. Subject: Re: More on TCL Nightmare.....................................
  5. Message-ID: <1993Jan23.234716.1435@kth.se>
  6. Sender: usenet@kth.se (Usenet)
  7. Nntp-Posting-Host: cyklop.nada.kth.se
  8. Organization: Royal Institute of Technology, Stockholm, Sweden
  9. References: <93019.113451REE700A@MAINE.MAINE.EDU>  <1993Jan22.010015.17871@netcom.com> <93023.121559REE700A@MAINE.MAINE.EDU>
  10. Date: Sat, 23 Jan 1993 23:47:16 GMT
  11. Lines: 43
  12.  
  13. In <93023.121559REE700A@MAINE.MAINE.EDU> REE700A@MAINE.MAINE.EDU writes:
  14.  
  15. >  Now, this amounts to 60,000 LongRects (hence 240,000 LongInt assigns,
  16. >and 120,000 LongInt adds, so the math of generation is non-negigible.
  17.  
  18. >FillRect'ed them.
  19.  
  20. >  A simple scroll - refresh took 10 seconds on my SE/30 !  Obviously,
  21. >this ain't no Quadra and it is a lot of drawing, but seriously...
  22.  
  23. Add the data accesses for drawing each item, and for the stack
  24. to pass parameters to and fro, and the trap dispatcher, you'll
  25. get a pretty hefty memory dependency (what's the cycle per
  26. longword access in an SE/30? 120 ns?) PLUS you have a lot of
  27. instructions even to just determine where the LongRects are,
  28. do the trap, intersect with the window, clip, and maybe draw.
  29. I don't think 10 seconds is in any way unreasonable, considering
  30. what you're doing.
  31.  
  32. >  Any useful suggestions on how to speed this process up?
  33.  
  34. Yes, it's very simple; your Draw() method gets a Rect passed
  35. to it; that Rect contains the area that actually needs to
  36. be drawn. I don't know what data structures you have, but
  37. some simple binary search over sorted coordinates, or some
  38. other clever way of knowing what rectangles to draw without
  39. checking each and every one would probably help tremendously.
  40.  
  41. >  BTW - HOW DO I GET THE DEBUGGER INTO THE EVENT HANDLING PORTION OF
  42. >        MY APPLICATION WITHOUT MANUALLY SETING THE EVENT MESSAGE?
  43.  
  44. Uh? You mean break when getting an event, or just look at
  45. a place in the code?
  46.  
  47. Open the relevant part in Think C, highlight a line you want
  48. to have in the debugger, and press "Debug" (cmd-I) and the
  49. debugger will go there.
  50.  
  51. -- 
  52.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  53.   _/~|   Yellow
  54.  / * \_  Shark                      (This signature has won the "Worst ASCII
  55.  ~~~~\/  Software                    Logo of the Year" award)
  56.