home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / arch / 10995 < prev    next >
Encoding:
Internet Message Format  |  1992-11-21  |  4.7 KB

  1. Xref: sparky comp.arch:10995 comp.benchmarks:1758
  2. Path: sparky!uunet!think.com!ames!sun-barr!cs.utexas.edu!news
  3. From: wilson@cs.utexas.edu (Paul Wilson)
  4. Newsgroups: comp.arch,comp.benchmarks
  5. Subject: Caches & GC's (was Re: Lisp performance...)
  6. Date: 21 Nov 1992 18:13:24 -0600
  7. Organization: CS Dept, University of Texas at Austin
  8. Lines: 93
  9. Distribution: world
  10. Message-ID: <lgtk54INNqjr@boogie.cs.utexas.edu>
  11. References: <1e824rINNlpu@iraul1.ira.uka.de>
  12. NNTP-Posting-Host: boogie.cs.utexas.edu
  13.  
  14. In article <1e824rINNlpu@iraul1.ira.uka.de> wolpers@i11s10.ira.uka.de (Andreas Wolpers) writes:
  15. >Hello everybody,
  16. >
  17. >I'm having a minor problem on which I would welcome any comments:
  18. >Since I'll have some money to spend real soon now, I've been pondering
  19. >whether we should switch from Sun to HP. The usual benchmark results
  20. >suggest that a change might result in faster execution of our pet
  21. >program, a large "theorem prover" written in Lisp.
  22. >
  23. >From the SpecInt92 results, one should expect a performance increase
  24. >of about a factor of 2 when switching from a SS2 to either s SS10-30
  25. >or HP720. Unfortunately, on both machines turned out to but just
  26. >30% faster than a SS2 when running our system (for which ps NEVER
  27. >shows a resident set under 3-4 MB, not even on an 8MB machine).
  28. >
  29. >Any explanations at hand? Did we encounter a bottleneck between
  30. >CPU and memory, or what?
  31.  
  32. Could be.  If you don't have a generational GC, your locality is
  33. going to be the pits.  If you allocate a lot of data between
  34. garbage collections, you'll typically incur a cache miss and
  35. a writeback for every block of memory you allocate.  That's
  36. because you can't reuse memory until you know it's garbage,
  37. so you're always allocating something you haven't used for
  38. a long time, i.e., at least since the last garbage collection.
  39.  
  40. What you want is a generational garbage collector and a cache
  41. large enough to hold the youngest generation.  This lets you
  42. allocate less-than-a-cache-full of data between garbage
  43. collections, reclaim most of the space, and reuse it at
  44. the next gc cycle.
  45.  
  46. The youngest generation should generally be >100KB for basic
  47. GC efficiency reasons (space-time tradeoffs), so you can't
  48. really expect to stay in a first-level cache for your heap
  49. allocations.  You could stay in a megabyte-range second
  50. or third level cache.
  51.  
  52. > What performace should I expect from
  53. >a SS10-41 or SS10-52 (which have a larger cache, but still not 
  54. >large enough to hold the Lisp's resident set. And if I'm not
  55. >mistaken, the large cache results in a longer time spent for
  56. >non-cache memory accesses (6 cycles instead of 3)). What 
  57. >performace should I expect from a HP735?
  58.  
  59. If cache misses on allocation are your problem, you're limited
  60. by the rate of allocation and the cache miss service time,
  61. plus something for write backs.  (You'll typically incur a
  62. write-back of a dirty block for each block of heap data you
  63. allocate, since the cache will be mostly full of relatively
  64. recently allocated---hence written--garbage.  This can overload
  65. your write buffers in a hurry for some programs.)
  66.  
  67. You also need to add something extra if it's a direct-mapped
  68. cache---gc'd systems are especially sensitive to DM cache
  69. conflicts.  (Actually, it's kinda weird--DM works BETTER
  70. if the youngest generation almost fits in the cache, but
  71. not quite.)
  72.  
  73. So if you know the rate of allocation in your application,
  74. you should be able to figure a ballpark cache miss cost
  75. without much trouble.
  76.  
  77. (For more on this, see Wilson, Lam, and Moher, "Caching Considerations
  78. for Generational Garbage Collection," ACM Lisp & Functional Programming
  79. '92.)
  80.  
  81. >I can buy enough memory so that disk speed is no criterion.
  82. >Should I wait for machines with 8MB of cache? Should I shoot myself?
  83. >Should I give YOU the money? :-)
  84.  
  85. You might want to look for a better Lisp system instead, with
  86. a generational GC.  Higher cache-to-memory bandwidth could be a 
  87. big win, or even just a bigger block size.  (It depends on whether 
  88. you're running up against bandwidth problems or latency problems, 
  89. but 32- or 64-byte blocks are probably considerably better than 16.
  90. Prefetching would probably work even better than large block sizes,
  91. up to the point you're bandwidth-limited.)
  92.  
  93. If you DO have a generational GC, it's important to have high
  94. bandwidth to any caches that won't hold the youngest generation,
  95. and it's good to have a great big secondary cache that will.
  96.  
  97. And yes, you definitely should send me the money, if there's any 
  98. left over after buying a machine with a MB or so of cache.
  99.  
  100.     -- Paul
  101.  
  102. -- 
  103. | Paul R. Wilson                                    wilson@cs.utexas.edu      |
  104. | U. of Texas Computer Sciences Dept.               voice: (512) 471-9555     |
  105. | Taylor Hall 2.124, Austin, TX 78712-1188          fax:   (512) 471-8885     |
  106. | "Inertia makes the world go 'round."                                        |
  107.