Subject: Re: LISP & "The Art of Unix Programming"
From: rpw3@rpw3.org (Rob Warnock)
Date: Wed, 05 Nov 2003 07:03:25 -0600
Newsgroups: comp.lang.lisp
Message-ID: <HJqdnTaZu_GAaDWiXTWc-w@speakeasy.net>
Pascal Bourguignon  <spam@thalassa.informatimago.com> wrote:
+---------------
| Please, remember  that any file read is  kept in core as  long as that
| memory  is used  and not  needed for  something else.   When  you pipe
| several times  the same program it's  read only once the  same text is
| shared.  The  second time,  you only pay  the initialization of  a new
| process. (Same for perl, it's a generic feature of unix).
| 
| $ time clisp -norc -x '(ext:quit)'
...
| $ time clisp -norc -x '(ext:quit)'
| real    0m0.068s
| user    0m0.040s
| sys     0m0.020s
+---------------

Exactly, which is why I have switched to CMUCL for all my "scripting",
even though the first time it runs it's a lot slower than CLISP. Here are
the times for the tenth running of each on my machine (1.4 GHz Athlon):

    % time clisp -norc -x '(ext:quit)'
    0.016u 0.008s 0:00.02 50.0%     7140+4348k 0+0io 0pf+0w
    %
...
    % time cmucl -noinit -eval '(quit)'
    0.012u 0.005s 0:00.01 100.0%    252+3620k 0+0io 0pf+0w
    %

Note: The individual "user" and "system" times seem to move around
a lot, but in both cases the *sum* of the two seems to remain reasonably
constant, that is, 24ms for CLISP and 16-17ms for CMUCL.

And then when you compare loading and running some substantial piece
of compiled code in each, well, CMUCL just gets faster...  ;-}


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607