home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12339 < prev    next >
Encoding:
Text File  |  1992-08-14  |  2.3 KB  |  60 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!gumby!wupost!monsanto.com!skws02!bcschu
  3. From: bcschu@skws02.monsanto.com (Brett Schultz)
  4. Subject: Re: Optimizing code for tests
  5. Message-ID: <1992Aug14.192350.4786@tin.monsanto.com>
  6. Sender: news@tin.monsanto.com (USENET News System)
  7. Organization: Monsanto Company
  8. References: <1992Aug12.200303.25050@tin.monsanto.com>
  9. Date: Fri, 14 Aug 1992 19:23:50 GMT
  10. Lines: 48
  11.  
  12. bcschu@skws02.monsanto.com (Brett Schultz) writes:
  13. : I am writing a computationally expensive program now.  In order to make it
  14. : run faster, I compiled each object using cc with the -j option and then the
  15. : entire thing with the -O3 option.  This didn't run any faster than when I had
  16. : used the -g option.  What can the compiler do to help the program run faster?
  17. : My program is expensive also due to comparisons.  I think that is what Jeffrey
  18. : L Bromberg was talking about.  I think what he was asking is if the compiler 
  19. : optimizes comparisons in your algorithm (right??).  I don't know if he tried
  20. : to use the compiler optimization options.  Try it and let me know what you get.
  21. : Did I use the optimatization options correctly with cc, and if so, why didn't
  22. : it make my program faster.
  23. : Any input will be helpful
  24. : Thanks in advance.
  25. : Brett
  26. : bcschu@skws02.monsanto.com
  27.  
  28.  
  29.  
  30. Many of you have sent me mail asking what system, compiler etc....
  31.  
  32. I am using a sgi 240 and a unix OS.
  33. : run faster, I compiled each object using cc with the -j option and then the
  34.                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  35.  
  36. cc is the compiler.
  37.  
  38. Many of you have also suggested to look for bottlenecks in my program.
  39. I appreciate the info, but I have already found the bottlenecks and just
  40. thought that optimized code runs faster than non-optimized code (esp. when
  41. compiled with debugging info).  However, my question was that when I compiled
  42. my code with, from what I understood from our man pages on cc, that one had
  43. to compile individual objects using a -j option.  It is like the -O3 option,
  44. but for objects.  Our cc compiler will not let me compile objects with the
  45. -O3 option.  When I compile with -j, it produces a ".u" file.  I wasn't really
  46. sure if I was compiling correctly, and what to do with the .u files.
  47.  
  48. Sorry about the confusion and thanks for the input.  I hope this clarifies
  49. things.
  50.  
  51. Brett
  52.