home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17909 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  3.8 KB

  1. Xref: sparky comp.sys.amiga.programmer:17909 comp.sys.amiga.misc:19194
  2. Newsgroups: comp.sys.amiga.programmer,comp.sys.amiga.misc
  3. Path: sparky!uunet!paladin.american.edu!gatech!concert!sas!mozart.unx.sas.com!walker
  4. From: walker@twix.unx.sas.com (Doug Walker)
  5. Subject: Re: AmigaDOS vs. ANSI SAS implementation [Was Re: SAS C6.1 datecmp bug]
  6. Originator: walker@twix.unx.sas.com
  7. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  8. Message-ID: <C01BE5.ALJ@unx.sas.com>
  9. Date: Tue, 29 Dec 1992 18:58:53 GMT
  10. References: <BzD93n.JCo@usenet.ucs.indiana.edu> <BzEqDF.A5H@unx.sas.com> <DMAK.92Dec25000536@dec5120a.ccs.northeastern.edu>
  11. Nntp-Posting-Host: twix.unx.sas.com
  12. Organization: SAS Institute Inc.
  13. Lines: 65
  14.  
  15.  
  16. In article <DMAK.92Dec25000536@dec5120a.ccs.northeastern.edu>, dmak@dworkin.ccs.northeastern.edu (Dave Mak) writes:
  17. |> Some people seem to be getting difftime and datecmp (two different functions)
  18. |> confused, but this leads me to another question:
  19. |> 
  20. |> Forgive me if this shows off my ignorance in compiler design, but I'm curious
  21. |> as to which routines are better performance wise.  AmigaDOS or their ANSI
  22. |> equivalents?  Case in point: ANSI time routines vs. AmigaDOS stuff.  Is it a
  23. |> simple programmer preference (portability bet. diff. systems vs. portability
  24. |> bet. diff. Amiga compilers?) or are their performance differences?
  25.  
  26. Usually ANSI routines must be implemented "on top of" system routines,
  27. at least for things like timer calls and I/O.  This implies that they
  28. will make your code larger.  On time calls, the AmigaDOS call will
  29. probably be faster, too.  However, the ANSI library functions are
  30. buffered, which means that they will probably give better performance
  31. than AmigaDOS Read() and Write() on most programs... it really depends
  32. on your application.
  33.  
  34. The general rule is, use the lowest-level routine that you can
  35. conveniently use.  Given two routines of equal functionality,
  36. one at the system level and one at the ANSI library level,
  37. the system level will probably be smaller and faster; however,
  38. if your program must run on other systems, the ANSI routines
  39. are more "convenient" for you.
  40.  
  41. |> Does clock() {ANSI} return a value based on the hardware clock less accurately
  42. |> than the timer() {AmigaDOS} ignoring their return type differences?
  43.  
  44. Actually, clock() is an exception.  I implemented clock() myself,
  45. and it is pretty efficient and does use AmigaDOS calls directly.
  46. I don't think you could do much better in your own code.
  47.  
  48. |> >(Actually, assuming the fields in the DateStamp structure can
  49. |> >never be negative, you could use a simple memcmp() on it...
  50. |> >hmmm....)
  51. |> 
  52. |> Is this a hint on how you might optimize functions that do this?
  53.  
  54. No, I don't think it would be a good idea.  Somebody somewhere will
  55. have done some operations on the DateStamp structure and the fields
  56. WILL come out negative.  You could, of course, use that technique
  57. on your own code if you're confident that never happens to you.
  58.  
  59. |> Just wanted to add my $.02 worth re: SAS/C v6.x.  After receiving version 6.0
  60. |> in the mail as an upgrade, I was really impressed by the professional quality
  61. |> of the package.  Admittedly, a lot of the major changes (ie: better Workbench
  62. |> interface) was in 5.10b, but the new context sensitive help, EMITS tech.
  63. |> support and performance improvements brings the premier Ami. C devel. package
  64. |> just C++ shy from Borland C Pro. -- The top C devel. system for
  65. |> MS-DOS/Windows.
  66.  
  67. Thanks for the compliment, and the support.
  68.  
  69. |> REPLY TO: dmak@draper.com    OR    dmak@dworkin.ccs.northeastern.edu
  70.  
  71. -- 
  72.   *****
  73. =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
  74.  *|. o.| ||                                          1200/2400/9600 Dual
  75.   | o  |//     For all you do, this bug's for you!
  76.   ====== 
  77. usenet: walker@unx.sas.com                            bix: djwalker 
  78. Any opinions expressed are mine, not those of SAS Institute, Inc.
  79.  
  80.