home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18333 < prev    next >
Encoding:
Text File  |  1992-12-22  |  2.4 KB  |  56 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!cybvax0!zeev
  3. From: zeev@cybvax0.uucp (Zeev Mehler)
  4. Subject: Special-purpose-heap-managers - references, FTP?
  5. Message-ID: <1992Dec22.165826.4391@cybvax0.uucp>
  6. Organization: Cybermation, Inc.
  7. Date: Tue, 22 Dec 92 16:58:26 GMT
  8. Lines: 46
  9.  
  10. > BS says, that use of a special-purpose-heap-manager could speed up a program,
  11. > -that is, a "normal" program, that uses medium-heavy dynamic-allocation, 
  12. > I guess(!)-, with a factor 2! Based on a few simple tests, I would not be 
  13. > surpriced, if the speed-up could be much, much higher - say, 100x for a not 
  14. > too heavily, dynamically allocating program of mine! Is that unrealistic; 
  15. > based on an unrealistic, simple test? 
  16.  
  17. > Could anyone, -who have tried-, tell, what kind of experiences they have with 
  18. > special-purpose-heap-managers like 'Pool', in what kind of program, with what 
  19. > kind of result/speed-up? 
  20.  
  21. >         -- Morten.
  22.  
  23. Since this is an area that we are currently working in I'll throw in my 2 cents
  24. worth on the subject.
  25.  
  26. C++ tends to exercise the heap manager very intensively.  Some system vendors
  27. have put in quite a bit of effort to improve their malloc packages to 
  28. primarily become space effecient.  Typical programs on these machines
  29. running in memory, spend less than 10 percent of their time in malloc.  Memory
  30. buffering tricks will save max about 5% of run time.
  31.  
  32. However, if a program is in a situation where paging is unavoidable, which
  33. tends to occur more quickly for systems that have not made their mallocs space 
  34. effecient, then the time a program spends in malloc/free can jump dramatically.
  35.  
  36. In a paging situation, focusing on managing free lists and being able to 
  37. reallocate efficiently becomes paramount to a C++ programs performance.  
  38.  
  39. Ideally one wants a system that works very quickly in memory, but also 
  40. inherently minimizes paging hits.
  41.  
  42. In practice we have found that for optimum performance one needs a variety
  43. of allocation strategies that work together.  A strategy that works well for 
  44. 32 byte allocations is not necessarily optimum for 700 byte allocations.
  45.  
  46. While it is possible to accomplish this on a class basis, we feel that this 
  47. stuff should be hidden from the individual programmer and managed on a system 
  48. wide basis.
  49.  
  50.                        Ze'ev
  51. -- 
  52. -------------------------------------------------------------------------------
  53. Ze'ev Mehler                Tel: (617) 396-3009  
  54. NewCode Technology, Inc.        Fax: (617) 395-9452
  55. 200 Boston Ave.                Email: zeev%cybvax0@uunet.uu.net
  56.