home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / amiga / programm / 16006 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.7 KB  |  60 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!eff!sol.ctr.columbia.edu!spool.mu.edu!sgiblab!munnari.oz.au!metro!usage!usage!geoffo
  3. From: geoffo@spectrum.cs.unsw.oz.au (Geoff Oakley)
  4. Subject: Re: Unusual SAS6.0 results
  5. In-Reply-To: koren@fc.hp.com's message of Sun, 15 Nov 1992 19:48:07 GMT
  6. Message-ID: <GEOFFO.92Nov18125942@crimson.spectrum.cs.unsw.oz.au>
  7. Sender: news@usage.csd.unsw.OZ.AU
  8. Nntp-Posting-Host: crimson.spectrum.cs.unsw.oz.au
  9. Organization: none
  10. References: <BxrwC8.3AG@fc.hp.com>
  11. Date: Wed, 18 Nov 1992 02:59:42 GMT
  12. Lines: 46
  13.  
  14. In article <BxrwC8.3AG@fc.hp.com> koren@fc.hp.com (Steve Koren) writes:
  15.  
  16.    [ a particular module ]  runs as before, but it is *much* slower.  I'm talking
  17.    about 20X here.  It is getting no enforcer hits; I've checked that.  Since
  18.    I really wanted to get it back to its old execution speed, I did a
  19.    lprof and lstat on it.  I'm getting _really_ wierd results.
  20.  
  21. I am getting something similar, which I will tell EMITS when my
  22. registration comes through.  I isolated my problem down to the
  23. following:
  24.  
  25.    #include <stdio.h>
  26.    #include <stdlib.h>
  27.    
  28.    void main ()
  29.    {
  30.      int i,j;
  31.    
  32.      putchar('?');
  33.      for (i=0 ; i<80 ; i++)
  34.        for (j=0 ; j<80 ; j++)
  35.          free(malloc(j));
  36.    }
  37.  
  38. Compiled with
  39.  
  40.    sc link test.c
  41.  
  42. the program runs in 2 seconds.
  43.  
  44.  
  45. The interesting thing is when I remove the `putchar' line.  When I
  46. recompile, the program runs in 108 seconds.  SAS/C v5.10a takes 2
  47. seconds for both versions.
  48.  
  49. Am I doing something totally whacky?
  50.  
  51.  
  52. geoff o
  53.  
  54.  
  55. --
  56.  
  57.            geoffo@cse.unsw.edu.au
  58. Geoff Oakley:  CS & E, UNSW, PO Box 1, Kensington, NSW 2033, Australia
  59.            Phone: +61 2 697 4043    Fax: +61 2 313 7987
  60.