🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.archives
Article #511

[comp.lang.clos] August 28 PCL

#511
From: Richard Harris
Date: Tue, 01 Sep 1992 23:55
67 lines
3979 bytes
Archive-name: auto/comp.lang.clos/August-28-PCL


I have just placed a new version of PCL on parcftp.xerox.com, in the
directory /pub/pcl, named August-28-92-PCL.tar.Z.  The file 
August-28-92-Systems.tar.Z contains PCL, CLX R5, and an inspecter.
Unless your system already includes a good inspecter, I recommend using
this one.

This version has been tested in Lucid CL 4.0.1 and in CMUCL 16e.

This version has extensive make-instance optimizations: make-instance
should run faster in every case, much faster for instances with many slots, 
and fastest for make-instance calls with constant keyword arguments appearing
within methods or inside a PCL::EXPANDING-MAKE-INSTANCE-TOP-LEVEL form.
Furthermore, there is essentially no overhead for keyword argument checking in
make-instance or reinitialize-instance.

Here is an example of how to get the fastest make-instance:
(Note that calls to make-instance from within defmethods are automatically
optimized.)

(pcl::expanding-make-instance-top-level
(defun n-make-variable-initargs1 (N)
  ;; Much slower than n-make! -- Not true in this PCL!
  (let ((x 0) (y 5))	
    (operations-per-second (make-instance 'point :x x :y y) n)))
)

According to the bench-this-clos benchmark, this version is faster
than March 92 PCL 2c for everything except default method only calls.
The reason it is slower there is because method functions have a special
calling protocol (see MAKE-METHOD-LAMBDA in The Art of the MetaObject 
Protocol).

I ran the benchmark on a sun4 (but I don't know which model),
using Lucid's Sun Common Lisp 4.0.1.  (This is the bench-this-clos code 
that was posted to comp.lang.lisp by jmorrill@bbn.com a few days ago;
It is included as the file bench.lisp.)

These numbers are in operations per second.

                                   March 92 2c        Aug 28
1 default method:                  980392.1568627451  301204.8192771085
1 dispatch, 1 method:              168918.91891891894 226244.34389140274
1 dispatch, :around + primary:      42337.00254022015 118764.84560570072
1 dispatch, 3 methods, instance:   120192.3076923077  171821.30584192442
1 dispatch, 3 methods, noninstance: 78003.12012480499 148809.52380952382
2 dispatch, 2 methods:              85324.23208191127 132978.72340425532
slot reader method:                226244.34389140274 284090.9090909091
with-slots (1 access):             108459.86984815619 114678.89908256881
with-slots (1 modify):              89928.05755395684 113378.68480725623
naked slot-value:                  144508.67052023122 231481.4814814815
class-of instance:                 207468.8796680498  657894.7368421053
class-of noninstance:               95969.28982725527 221238.93805309737
allocate-instance (2 slots):        12543.90366281987  14343.08663224326
unoptimized make-instance
make-instance (2 slots):             2514.331690636629  3051.3853289393387
make-instance (2 constant initargs): 2274.1744746656964 2327.09671413944
make-instance (2 variable initargs): 2274.1744746656964 2327.09671413944
optimized make-instance
make-instance (2 slots):                               13564.839934888769
make-instance (2 constant initargs):                   12543.90366281987
make-instance (2 variable initargs):                   12543.90366281987


  Richard Harris
Technical Details
Message-ID: <180vucINNqan@agate.berkeley.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.INS.CWRU.Edu!agate!agate!usenet
References: <ktry+rl@rpi.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.INS.CWRU.Edu!agate!agate!usenet
From: rharris@ptolemy2.rdrc.rpi.edu (Richard Harris)
Newsgroups: comp.archives
Subject: [comp.lang.clos] August 28 PCL
Followup-To: comp.lang.clos
Date: 1 Sep 1992 23:55:56 GMT
Organization: Rensselaer Polytechnic Institute, Troy, NY
Lines: 68
Approved: adam@soda.berkeley.edu
Distribution: world
Message-ID: <180vucINNqan@agate.berkeley.edu>
References: <ktry+rl@rpi.edu>
NNTP-Posting-Host: soda.berkeley.edu
X-Original-Newsgroups: comp.lang.clos
X-Original-Date: Sat, 29 Aug 1992 02:55:29 GMT