Newsgroups: comp.lang.lisp.franz
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!godot.cc.duq.edu!news.duke.edu!agate!howland.reston.ans.net!newsfeed.internetmci.com!in1.uu.net!netnews.jhuapl.edu!aplcenmp!hall
From: hall@aplcenmp.apl.jhu.edu (Marty Hall)
Subject: Re: CLOS generic functions seem to have excessive heap allocation behavior
Message-ID: <DqDCxL.76K@aplcenmp.apl.jhu.edu>
Organization: JHU/APL Research Center, Hopkins P/T CS Faculty
References: <4lefq6$3bq@decius.ultra.net> <dlamkins-2204960836210001@news.teleport.com> <4lk32j$qen@decius.ultra.net>
Distribution: inet
Date: Wed, 24 Apr 1996 13:46:33 GMT
Lines: 32

In <4lk32j$qen@decius.ultra.net> tenny@games.ultranet.com (Dave Tenny) writes:

>(defmacro test-space (&body body)

I haven't used ACL/Windows, but with ACL on Unix (and other Lisps),
TIME accurately reports consing. So you can do
(time (progn <Forms>)) instead of (test-space <Forms>).


>(test-space (foo *a*))				;consumes no memory
>(test-space (foo *b*))				;consumes 48 bytes (!!)
>(test-space (cons 'a nil))			;consumes 12 bytes (!)

I would expect the third item to cons, since you are invoking the
interpreter. Or is ACL/Windows different due to its incremental
compilation only? Anyhow, on ACL/Unix and LispWorks/Unix:

(A) (time (cons 'A nil))
    ACL:       3 cons cells
    LispWorks: 264 bytes

(B) (defun Foo () (cons 'A nil)) ; You need (compile 'Foo) on ACL/Unix and LW

    (time (Foo))
    ACL:       1 cons cell
    LispWorks: 12 bytes


Cheers-
						- Marty
(proclaim '(inline skates))
http://www.apl.jhu.edu/~hall/lisp.html
