Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!news.ultranet.com!news.sprintlink.net!pipex!sunic!sunic.sunet.se!trane.uninett.no!nntp.uio.no!nac.no!news.kth.se!news.ifm.liu.se!liuida!stesv
From: stesv@ida.liu.se (Stefan Svenberg)
Subject: Re: Inline expansions in Allegro 4.2
X-Nntp-Posting-Host: brut4.ida.liu.se
Message-ID: <D9uyus.66L@ida.liu.se>
Sender: news@ida.liu.se
Organization: CIS Dept, Linkoping University, Sweden
References: <D8vGs7.C3q@ida.liu.se> <KANDERSO.95May20182208@bitburg.bbn.com> <3qrg5j$98r@freespeech.tu-graz.ac.at>
Date: Thu, 8 Jun 1995 14:28:03 GMT
Lines: 47

rurban@sbox.tu-graz.ac.at (Reinhard Urban) writes:

>Ken Anderson (kanderso@bitburg.bbn.com) wrote:
>> In article <D8vGs7.C3q@ida.liu.se> stesv@ida.liu.se (Stefan Svenberg) writes:
>>    Does anyone know why the Allegro compiler never inlines user functions? Is 
>>    it because it does not provide any advantages in speed, or what?
>> I consider Allegro's decision to ignore inline declarations as a gross sin.
>> For now, you can write a DEFINE-INLINE macro that will let you write
>> inlined functions easily.
>> Ken Anderson 

>Could it be, that small inline functions have a overhead in calling time, so
>that only larger functions gain the compilation effort?

Quite the contrary.

The people at Franz picked up my original posting and mailed me a reply.
That's quite impressive. They said that they believe there are other 
improvements that can be made that provide more advantages. They also proposed
to use compiler macros, which I already had tried, as I wrote a macro
definline that generated a compiler macro along with the function definition.

My problem was not really acute, but
what really bothered me is that the benefits of inlining built-in functions 
are lost if you have small primitive functions working on accessing parts 
of dataobjects. Suppose we have a database that happened to be implemented
as a list, where there is an accessor function:

(defun first-of-db (db)
  (car db))

If car is compiled inline, that's fine. But it is annoying that first-of-db 
can't be. This is ridiculous.

Inlining sounds conceptually simple; just substitute the function call for 
the body along with the arguments. But maybe it is not that simple, I do not
know.

I have experiences working with Xerox Lisp, where inlining was very useful. 
The compiler did many clever optimizations on the code.

/Stefan
--
Stefan Svenberg                               email: ssv@ida.liu.se
Department of Computer Science                Phone: +46 13 28 26 90
University of Linkoping
581 83  Linkoping, SWEDEN
