Newsgroups: comp.lang.scheme,comp.lang.dylan,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!purdue!lerc.nasa.gov!magnus.acs.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!ix.netcom.com!netcom.com!NewsWatcher!user
From: hbaker@netcom.com (Henry Baker)
Subject: Re: (debunk-myth '(debunk-myth '(<-efficient gc malloc/free)))
Message-ID: <hbaker-2810951247090001@10.0.2.15>
Sender: hbaker@netcom8.netcom.com
Organization: nil organization
References: <QOBI.95Oct22061418@qobi.ai> <46ivje$k1u@serra.unipi.it> <QOBI.95Oct26014210@qobi.ai>
Date: Sat, 28 Oct 1995 20:47:09 GMT
Lines: 32
Xref: glinda.oz.cs.cmu.edu comp.lang.scheme:14168 comp.lang.dylan:5687 comp.lang.lisp:19759

In article <QOBI.95Oct26014210@qobi.ai>, Qobi@CS.Toronto.EDU wrote:

> Absolute performance is irrelevant to this discussion. The issue is the
> relative performance of the imperative vs. function versions. To date these
> benchmarks have been run by different people under several different Scheme
> implementations on several different machine architectures. All of them
> indicate that the imperative version is faster than the functional one, by a
> factor of between 1.5 and 3.

The Lisp 'FRPOLY' benchmark is a test of multivariate polynomial multiplication
code, perhaps from the original 'Mathlab' program.  Since this code is written
in an 'imperative' style, I rewrote it in a 'functional' style and got within
6% or so of the performance of the original code, AND MY CODE INCLUDED
RECYCLING TIME, while the original code was benchmarked in such a way that
the GC wasn't ever called.

Now, my 'functional' program used 'linear types' -- a kind of object which
has a [0,1] reference count (it is singly-referenced) -- so that no reference
count updating was actually required, and dead cells could be recognized and
recycled immediately.

So, at least if you use 'linear types', you can program in a completely
functional style, and yet have the efficiency of an imperative style.

Details in:

ftp://ftp.netcom.com/pub/hb/hbaker/LFrpoly.html  (also .ps.Z)
ftp://ftp.netcom.com/pub/hb/hbaker/Use1Var.html  (also .ps.Z)

-- 
www/ftp directory:
ftp://ftp.netcom.com/pub/hb/hbaker/home.html
