Newsgroups: comp.lang.clos
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!uhog.mit.edu!bloom-beacon.mit.edu!usc!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!scsing.switch.ch!news.belwue.de!news.belwue.de!news.uni-ulm.de!rz.uni-karlsruhe.de!xlink.net!news.ppp.de!news.Hanse.DE!wavehh.hanse.de!cracauer
From: cracauer@wavehh.hanse.de (Martin Cracauer)
Subject: Re: CMU-CL CLOS efficiency?
Message-ID: <1995May31.094028.6176@wavehh.hanse.de>
Organization: The poor LISPers' hacking kitchen
References: <mmcconn.801347647@klein.math.okstate.edu> <D9EC6p.9Cy@ssbunews.ih.att.com> <D9EFxy.B2L@ssbunews.ih.att.com>
Date: Wed, 31 May 95 09:40:28 GMT
Lines: 38

clarisse@iexist.flw.att.com (55437-olivier clarisse(haim)463) writes:

>With PCL the cost of method invocation might be higher than with
>other CLOS that have been optimized by their respective vendors.

I did some benchmarking and found that message calling in CMU-CL is
almost as fast as in Lispworks. Any other PCL-using implementation is
slower by magnitudes.

Although I didn't check the sources, I'm sure CMU has reimplemented at
least parts of PCL, so I wouldn't make assumptions about their
performance from the fact that their CLOS used to be PCL.

>However you can *never* go wrong if you use CLOS to model high level
>concepts in your application and use CL functional style programming
>and type declaration inside CLOS methods to encode efficient
>algorithms. My experience indicates *very* efficient code can be
>written this way.

>It is also likely (even in PCL) that a single method definition
>is as fast as a function definition (DEFUN), so you can
>really use methods everywhere and stay aware that there is potential
>overhead only in areas where CLOS will have to choose between
>multiple methods based on object types. [And even that overhead
>may not as bad as poorly written switch (case) and if statements
>- instead of lookup tables.]

From what I've seen, calling overhead of generic functions is pretty
independend of the number of methods defined for the generic
function. Thus, you cannot reach the speed of a pure function.

>[My personal experience... Not necessarily It's.]

Dito.
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@wavehh.hanse.de>. No NeXTMail, please.
 Norderstedt/Hamburg, Germany. Fax +49 40 522 85 36. This is a 
 private address. At (netless) work programming in data analysis.
