home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / bsd / 10240 < prev    next >
Encoding:
Text File  |  1992-12-15  |  4.0 KB  |  85 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!spooky!witr
  3. From: witr@rwwa.COM (Robert Withrow)
  4. Subject: Re: Shared lib benchmarks, and experiences
  5. Message-ID: <1992Dec15.141455.14369@rwwa.COM>
  6. Sender: news@rwwa.COM (News Administrator)
  7. Nntp-Posting-Host: spooky
  8. Reply-To: witr@rwwa.com
  9. Organization: R.W. Withrow Associates
  10. References: <1992Dec12.235116.7484@rwwa.COM> <1giendINNgku@life.ai.mit.edu> <1992Dec14.231025.12627@rwwa.COM> <BzAEnE.GKq@ra.nrl.navy.mil>
  11. Distribution: usa
  12. Date: Tue, 15 Dec 1992 14:14:55 GMT
  13. Lines: 70
  14.  
  15. In article <BzAEnE.GKq@ra.nrl.navy.mil>,
  16.  eric@tantalus.nrl.navy.mil (Eric Youngdale) writes:
  17.  
  18. | In article <1992Dec14.231025.12627@rwwa.COM> witr@rwwa.com writes:
  19.  
  20. | >The reason why I bring this up is that I suspect that it is difficult to
  21. | >assign ``compatible'' ``assigned'' addresses except in the case where the
  22. | >libraries are ``substantially identical''.  For example, if the latter library
  23. | >has twice as many entrypoints as the former, this is likely to be a difficult,
  24. | >problem and probably has no general solution.
  25.  
  26. | The first time
  27. | you build a sharable library, you select how much memory you want for the jump
  28. | vectors[...]
  29.  
  30. So as long as you reserve enough extra space and you cause (using tools) the
  31. jump table to be ordered appropriately, your libraries can be made forward
  32. compatible.  The following restrictions still apply:
  33.  
  34.   1) You must reserve enough space, which means wasting address space,
  35.      and, depending on how dynamicly the library changes, you may eventually
  36.      ``run out'' of space unless you are very liberal in what you reserve.
  37.      Neither of these problems is very major, assuming some care and
  38.      forethought in the creation of the library.
  39.  
  40.   2) You still ``pollute'' the address space of all processes, due to the
  41.      assigned addresses.  I personally think this is a serious drawback
  42.      because this problem only grows worse with time, and cannot ever
  43.      be reduced without creating incompatibility.  And it requires central
  44.      authority...
  45.  
  46. As a note, the jump table method improves load-time performance at the
  47. expense of per-call run-time overhead.  Most dynamic loaded library
  48. implementations improve run-time performance at the expense of load-time
  49. overhead by using other methods.  I somewhat prefer the latter because most
  50. processes I use (interactively) are long lived.
  51.  
  52. | Inter-calling (calls within the library) are all resolved by the
  53. | linker without having to even look at the jump table. 
  54.  
  55. Which, BTW, is a restriction.  A staticly loaded replacement for such
  56. a routine will not be called by the library code.  Typical examples
  57. are malloc() routines...
  58.  
  59. | There was another objection that has been raised in the past by various
  60. | people, and that is that in the 3/486 architecture there are relatively few
  61. | machine registers compared to something like a VAX.  The PI code that I have
  62. | seen GCC generate always seems to use up one register as a reference pointer of
  63. | some kind or another, and when you reserve this register (usually ebx) for this
  64. | purpose, it is not available to the compiler for other uses, and this could
  65. | lead to poorer performance. 
  66.  
  67. Given GCC's code generation strategy, this is likely to cause more frequent
  68. reloading.  Smart optimization can reduce this, but there is likely to be
  69. a micro-level performance hit using PIC.  *Macro* level performance is
  70. not affected to the degree that code examination would tend to indicate, due
  71. to program dynamics, and other savings that PIC can enable.  This gets into
  72. nitty details, but suffice to say that in real systems PIC is roughly
  73. performance neutral...
  74.  
  75. | Anyway, we have been refining the concept for about 6 months, and we
  76. | now have it to a point where the drawbacks are quite minimal.
  77.  
  78. I agree.  I still think that the benefits of DSLs make them worth the
  79. effort though.  I remember my sigh-of-relief when I went from SVR3 to
  80. SVR4 shared libraries...
  81.  
  82. -- 
  83.  Robert Withrow, Tel: +1 617 598 4480, Fax: +1 617 598 4430, Net: witr@rwwa.COM
  84.  R.W. Withrow Associates, 21 Railroad Ave, Swampscott MA 01907-1821 USA
  85.