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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!microsoft!hexnut!jimad
  3. From: jimad@microsoft.com (Jim Adcock)
  4. Subject: Re: Special-purpose-heap-managers - references, FTP?
  5. Message-ID: <1992Dec30.212505.10950@microsoft.com>
  6. Date: 30 Dec 92 21:25:05 GMT
  7. Organization: Microsoft Corporation
  8. References: <1992Dec29.184536.22437@src.dec.com>
  9. Lines: 40
  10.  
  11. In article <1992Dec29.184536.22437@src.dec.com> detlefs@src.dec.com (Dave Detlefs) writes:
  12. |I regard the proposition that special-purpose heap managers are "much
  13. |faster" than *all* general purpose ones as quite unproven.  
  14.  
  15. The counter-proposition also remains "unproven."
  16.  
  17. | It is
  18. |certainly true that there exist bad general purpose allocators, and
  19. |that special purpose allocators are much faster than these.  But this
  20. |does not imply that there can't be a really good general-purpose
  21. |allocator whose performance approaches the performance of writing a
  22. |special-purpose allocator for each class in your program.  In fact, I
  23. |believe that some variation on the Quickfit algorithm [1] fits the
  24. |bill.  If you want to look at some very interesting empirical studies
  25. |of allocator performance, I strongly recommend some papers by Ben Zorn
  26. |and Dirk Grunwald at the University of Colorado [2], [3].
  27.  
  28. I agree that Quickfit is a good algorithm that people should seriously
  29. examine for their object allocation needs if they haven't already done so.
  30. Mallocs are typically designed to handle larger-sized allocations than
  31. single-object, so mallocs are typically pretty poor choices for such needs.
  32. Converesly Quickfit doesn't help with large allocations.  Looking at 
  33. the inline code the authors generate for quickfit allocations makes
  34. it clear that fix-sized class-based allocations should be possible
  35. about twice as fast with about half as much generated code, so class-
  36. based allocators will remain popular for people trying to get very
  37. fast allocations.  Also, quickfit works pretty well for objects
  38. when temporal locality remains fixed [ie objects that are allocated
  39. together continue to be used together, and objects that weren't allocated
  40. together continue not to be used together].  Works terrible in situations
  41. where this is not true.  For example, in OODBMSs queries pull
  42. together objects into new working sets.  Objects needed together in this
  43. query may never had a relationship to each other in the past.  Quickfit
  44. does poorly in such a system since its assumptions that temporal locality
  45. ~= spatial locality are violated.  Such systems need moveable objects 
  46. and allocation systems supporting moveable objects instead.
  47.  
  48.  
  49.  
  50.  
  51.