home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / archives / 3177 < prev    next >
Encoding:
Text File  |  1992-09-01  |  3.8 KB  |  85 lines

  1. Path: sparky!uunet!wupost!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.INS.CWRU.Edu!agate!agate!usenet
  2. From: rharris@ptolemy2.rdrc.rpi.edu (Richard Harris)
  3. Newsgroups: comp.archives
  4. Subject: [comp.lang.clos] August 28 PCL
  5. Followup-To: comp.lang.clos
  6. Date: 1 Sep 1992 23:55:56 GMT
  7. Organization: Rensselaer Polytechnic Institute, Troy, NY
  8. Lines: 68
  9. Approved: adam@soda.berkeley.edu
  10. Distribution: world
  11. Message-ID: <180vucINNqan@agate.berkeley.edu>
  12. References: <ktry+rl@rpi.edu>
  13. NNTP-Posting-Host: soda.berkeley.edu
  14. X-Original-Newsgroups: comp.lang.clos
  15. X-Original-Date: Sat, 29 Aug 1992 02:55:29 GMT
  16.  
  17. Archive-name: auto/comp.lang.clos/August-28-PCL
  18.  
  19.  
  20. I have just placed a new version of PCL on parcftp.xerox.com, in the
  21. directory /pub/pcl, named August-28-92-PCL.tar.Z.  The file 
  22. August-28-92-Systems.tar.Z contains PCL, CLX R5, and an inspecter.
  23. Unless your system already includes a good inspecter, I recommend using
  24. this one.
  25.  
  26. This version has been tested in Lucid CL 4.0.1 and in CMUCL 16e.
  27.  
  28. This version has extensive make-instance optimizations: make-instance
  29. should run faster in every case, much faster for instances with many slots, 
  30. and fastest for make-instance calls with constant keyword arguments appearing
  31. within methods or inside a PCL::EXPANDING-MAKE-INSTANCE-TOP-LEVEL form.
  32. Furthermore, there is essentially no overhead for keyword argument checking in
  33. make-instance or reinitialize-instance.
  34.  
  35. Here is an example of how to get the fastest make-instance:
  36. (Note that calls to make-instance from within defmethods are automatically
  37. optimized.)
  38.  
  39. (pcl::expanding-make-instance-top-level
  40. (defun n-make-variable-initargs1 (N)
  41.   ;; Much slower than n-make! -- Not true in this PCL!
  42.   (let ((x 0) (y 5))    
  43.     (operations-per-second (make-instance 'point :x x :y y) n)))
  44. )
  45.  
  46. According to the bench-this-clos benchmark, this version is faster
  47. than March 92 PCL 2c for everything except default method only calls.
  48. The reason it is slower there is because method functions have a special
  49. calling protocol (see MAKE-METHOD-LAMBDA in The Art of the MetaObject 
  50. Protocol).
  51.  
  52. I ran the benchmark on a sun4 (but I don't know which model),
  53. using Lucid's Sun Common Lisp 4.0.1.  (This is the bench-this-clos code 
  54. that was posted to comp.lang.lisp by jmorrill@bbn.com a few days ago;
  55. It is included as the file bench.lisp.)
  56.  
  57. These numbers are in operations per second.
  58.  
  59.                                    March 92 2c        Aug 28
  60. 1 default method:                  980392.1568627451  301204.8192771085
  61. 1 dispatch, 1 method:              168918.91891891894 226244.34389140274
  62. 1 dispatch, :around + primary:      42337.00254022015 118764.84560570072
  63. 1 dispatch, 3 methods, instance:   120192.3076923077  171821.30584192442
  64. 1 dispatch, 3 methods, noninstance: 78003.12012480499 148809.52380952382
  65. 2 dispatch, 2 methods:              85324.23208191127 132978.72340425532
  66. slot reader method:                226244.34389140274 284090.9090909091
  67. with-slots (1 access):             108459.86984815619 114678.89908256881
  68. with-slots (1 modify):              89928.05755395684 113378.68480725623
  69. naked slot-value:                  144508.67052023122 231481.4814814815
  70. class-of instance:                 207468.8796680498  657894.7368421053
  71. class-of noninstance:               95969.28982725527 221238.93805309737
  72. allocate-instance (2 slots):        12543.90366281987  14343.08663224326
  73. unoptimized make-instance
  74. make-instance (2 slots):             2514.331690636629  3051.3853289393387
  75. make-instance (2 constant initargs): 2274.1744746656964 2327.09671413944
  76. make-instance (2 variable initargs): 2274.1744746656964 2327.09671413944
  77. optimized make-instance
  78. make-instance (2 slots):                               13564.839934888769
  79. make-instance (2 constant initargs):                   12543.90366281987
  80. make-instance (2 variable initargs):                   12543.90366281987
  81.  
  82.  
  83.   Richard Harris
  84.  
  85.