Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!think.com!linus!agate!bionet!arisia!roo!gregor From: gregor@parc.xerox.com (Gregor Kiczales) Newsgroups: comp.lang.clos Subject: Re: Speed of generic calls Message-ID: Date: 16 Nov 90 17:29:37 GMT References: <1990Nov14.180848.11612@cs.columbia.edu> Sender: news@parc.xerox.com Organization: Xerox Palo Alto Research Center Lines: 29 In-reply-to: djk@cs.columbia.edu's message of 14 Nov 90 18:08:48 GMT From: djk@cs.columbia.edu (David Kurlander) Date: 14 Nov 90 18:08:48 GMT In the versions of CLOS that you use, how does the speed of generic calls compare to that of vanilla function calls? I'm particularly interested in versions of Common Lisp that run on Sun 4's. To begin with the usual caveat, you have to watch out a bit for this ratio. It is, for example, easy to make generic function calls faster than ordinary function calls simply by "appropriately adjusting" the implementation of ordinary function calls. That said, CLOS implemtations can do pretty well on this benchmark. Even in PCL, the portable implementation of CLOS developed at PARC, we were able to obtain good numbers. For reader generic functions (those that call automatically generated reader methods) we ended up with ratios of about 2. For simple generic function lookups (one specialized argument, calling a primary method) we got ratios of about 3. Note that these numbers are from the best port of PCL we did, some other ports do not perform as well. Even so, these numbers, given that they come from PCL, make it clear that it is possible to do at least this well in CLOS. More importantly, the use of newer implementation techniques such as those found in Self, should make it possible to do much better. Another important caveat is that these numbers are for a "development-style" implementation of CLOS. In a "development-style" implementation it should be possible to get ratios of 1 pretty easily.