Article View: comp.lang.clos
Article #308Re: Built-in functions (was Re: Beginner's Question - CLOS)
From: Jeff Dalton
Date: Mon, 05 Oct 1992 13:46
Date: Mon, 05 Oct 1992 13:46
40 lines
2251 bytes
2251 bytes
In article <1992Sep20.141802.4612@gdr.bath.ac.uk> mascdb@gdr.bath.ac.uk (C D Burdorf) writes: >In article <9209181825.AA08510@thelonius.mitre.org> john@linus.mitre.org writes: >> >>True, but many (most?) of the "built-in" functions in a Lisp >>implementation are neither implemented in assembly language, nor are >>they usually open-coded into calling code. > >I'm suprised people are arguing with me on this point. I C coded >the exponential distribution function and did a foreign function >interface to CMU Lisp and it was many times faster than what the >CMU common lisp compiler could produce with declares and speed at 3 >and safety at 0. 1. The question was whether functions you write yourself can be as fast as (equivalent) built-in functions. And the answer is very often "yes". 2. It happens to be the case that most built-in functions are written in Lisp or C, not assembler (at least in most Lisps where I know something about the implementation). 3. Neither 1 nor 2 is in any way an argument that compiled Lisp is always as fast as hand-coded assembler. They're not even an argument that compiled Lisp is as fast as C. 4. Nonetheless, there are cases where Lisp is as fast, or faster than, C. There are also times when compiled code is faster than hand-coded assembler. (Indeed, not all assembly code is designed for max speed; sometimes readability considerations intervene.) >I've seen over and over again cases where people can write >assembly code that is faster than what Lisp compilers produce. > >HCL is a very fast (on sun3's) lisp and part of the reason is >that much of it is written in assembly language. Is it faster than other Lisps? How much faster? Is it faster than C? -- jd
Technical Details
Message-ID:
<7624@skye.ed.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!hri.com!spool.mu.edu!agate!doc.ic.ac.uk!uknet!edcastle!aiai!jeffReferences:
<9209181825.AA08510@thelonius.mitre.org> <1992Sep20.141802.4612@gdr.bath.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!hri.com!spool.mu.edu!agate!doc.ic.ac.uk!uknet!edcastle!aiai!jeff From: jeff@aiai.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.clos Subject: Re: Built-in functions (was Re: Beginner's Question - CLOS) Message-ID: <7624@skye.ed.ac.uk> Date: 5 Oct 92 13:46:24 GMT References: <9209181825.AA08510@thelonius.mitre.org> <1992Sep20.141802.4612@gdr.bath.ac.uk> Sender: news@aiai.ed.ac.uk Organization: AIAI, University of Edinburgh, Scotland Lines: 40