🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.clos
Article #176

Re: Beginner's Question - CLOS

#176
From: Jeff Morrill
Date: Tue, 25 Aug 1992 10:45
46 lines
2771 bytes
  
  > I think this concern over dispatch time is insane. It might have made
  > sense 20 years ago (that is, when C was invented) when computers were
  > < .1 mips and cost more than 5 years of a hacker's salary, but not
  > today when computers are > 20 mips and cost 1/5 of a hacker's salary.
  
I agree with RPG that this discussion seems a little penny-wise and pound foolish.

Here are some numbers to make this discussion more concrete.  The speed
of method dispatch is measured in "operations per second" and seems to be
accurate to about 5%.  

                                   XL-400        Sparc 1    Sparc 2
# dispatch args   # methods   |  Genera 8.0.1   Lucid 4.0  Allegro 4.1
-----------------------------------------------------------------------
       1              1       |     112,000      136,000     520,000
       1              3       |     133,000      131,000     503,000
       2              2       |      58,000       89,000     246,000

Forgive me for not being fair to the vendors by not performing the
benchmarks on a single machine, but I don't have the resources.
Indeed, I think the differences are due mainly to the hardware
rather than to the individual CLOS implementations.

I would add that in my experience, the cost of SLOT-VALUE (and reader
methods) is often the limiting factor in terms of performance.  Doesn't
anyone care about slot value?

                                   XL-400        Sparc 1    Sparc 2
                             |  Genera 8.0.1   Lucid 4.0  Allegro 4.1
-----------------------------------------------------------------------
 slot reader method          |      98,000       152,000    553,000
 with-slots (1 access)       |      77,000        24,000    170,000
 naked slot-value            |      34,000        53,000    139,000

So you see that if the ratio of slot access to method dispatch is
about 1:1, then the burden of performance is on slot-value.  In
my programs, the ratio of slot access to method dispatch is about
4:1, so its no contest.  Method dispatch is nothing in comparison with
what usually goes into the body of the method.

It would be interesting to see some numbers for C++.  Sure it's faster,
it doesn't have to do as much because the object-oriented essence
of the program can be optimized into oblivion.

jeff morrill
Technical Details
Message-ID: <4600.714768355@bbn.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!bbn.com!jmorrill

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.clos
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!bbn.com!jmorrill
From: jmorrill@bbn.com (Jeff Morrill)
Subject: Re: Beginner's Question - CLOS
Message-ID: <4600.714768355@bbn.com>
Sender: daemon@cis.ohio-state.edu
Reply-To: jmorrill@BBN.COM
Organization: The Ohio State University Department of Computer and Information Science
Date: Tue, 25 Aug 1992 10:45:55 GMT
Lines: 46