Re: Reasons to choose CLISP over other free implementations
- From: "Dimiter \"malkia\" Stanev" <malkia@xxxxxxxxx>
- Date: Thu, 29 Nov 2007 15:36:39 -0800
Juho Snellman wrote:
Javier <javuchi@xxxxxxxxx> writes:Basically, this depends on the kind of CLOS program you are doing. For
example, my program is doing millions of instantiations, and much less
method calls.
I will again point out that the common case of giving a constant class
name to MAKE-INSTANCE is much faster in SBCL:
(defclass a () ((x :initarg :x) (y :initarg :y) (z :initarg :z)))
(defun foo () (dotimes (i (expt 2 20)) (make-instance 'a :x 1 :y 2 :z 3)))
(compile 'foo)
(time (foo))
SBCL -> 0.089s
clisp -> 0.91s
And again, the case with an variable class name is much slower in
SBCL, but exactly the same speed in clisp. Maybe this is what you're
doing, and if so, clisp would be the faster choice for you. But it
seems pretty unreasonable for you to unconditionally claim that
instantiation of CLOS objects is slower in SBCL when the common case
is much faster.
(The code path for the non-constant cases of MAKE-INSTANCE is very
much unoptimized in SBCL. That it has not been optimized is probably
due to few people using that case in practice. At least I've never had
anyone report MAKE-INSTANCE with non-constant class or initarg names
as a bottleneck in their program before this.)
I wouldn't advise people to make decisions on what
implementation to not use, without understanding what the program of
everyone are actually doing. ;)
Luckily I didn't advise people on what implementations they should not
use. There are good reasons to use clisp. I'm just saying that the
benchmarks you're misinterpreting aren't such reasons.
Gah, SBCL didn't work on Windows:
C:\>which sbcl
/cygdrive/c/Program Files/Steel Bank Common Lisp/1.0.9/sbcl
C:\>sbcl
This is SBCL 1.0.9, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
This is experimental prerelease support for the Windows platform: use
at your own risk. "Your Kitten of Death awaits!"
* (defclass a () ((x :initarg :x) (y :initarg :y) (z :initarg :z)))
#<STANDARD-CLASS A>
* (defun foo () (dotimes (i (expt 2 20)) (make-instance 'a :x 1 :y 2 :z 3)))
FOO
* (compile 'foo)
FOO
NIL
NIL
* (time (foo))
fatal error encountered in SBCL pid 6792:
GC invariant lost, file "gencgc.c", line 832
LDB monitor
ldb>
-------------------------------------------------------------------------
C:\>which clisp
/usr/bin/clisp
(cygwin clisp)
C:\>CLISP
i i i i i i i ooooo o ooooooo ooooo ooooo
I I I I I I I 8 8 8 8 8 o 8 8
I \ `+' / I 8 8 8 8 8 8
\ `-+-' / 8 8 8 ooooo 8oooo
`-__|__-' 8 8 8 8 8
| 8 o 8 8 o 8 8
------+------ ooooo 8oooooo ooo8ooo ooooo 8
Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2006
[1]> (defclass a () ((x :initarg :x) (y :initarg :y) (z :initarg :z)))
#<STANDARD-CLASS A> (defun foo () (dotimes (i (expt 2 20)) (make-instance 'a :x 1 :y 2 :z 3)))
[2]> (defun foo () (dotimes (i (expt 2 20)) (make-instance 'a :x 1 :y 2 :z 3)))
FOO
[3]> (compile 'foo)
FOO ;
NIL ;
NIL
[4]> (time (foo))
Real time: 1.715 sec.
Run time: 1.703 sec.
Space: 75499920 Bytes
GC: 143, GC time: 0.924 sec.
NIL
[5]> (lisp-implementation-version)
"2.41 (2006-10-13) (built on ATGRZWN502840.avl01.avlcorp.lan [127.0.0.1])"
---------------------------------------------------------------------------
NON-CYGWIN CLISP
i i i i i i i ooooo o ooooooo ooooo ooooo
I I I I I I I 8 8 8 8 8 o 8 8
I \ `+' / I 8 8 8 8 8 8
\ `-+-' / 8 8 8 ooooo 8oooo
`-__|__-' 8 8 8 8 8
| 8 o 8 8 o 8 8
------+------ ooooo 8oooooo ooo8ooo ooooo 8
Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2006
[1]> (defclass a () ((x :initarg :x) (y :initarg :y) (z :initarg :z)))
#<STANDARD-CLASS A>
[2]> (defun foo () (dotimes (i (expt 2 20)) (make-instance 'a :x 1 :y 2 :z 3)))
FOO
[3]> (compile 'foo)
FOO ;
NIL ;
NIL
[4]> (time (foo))
Real time: 0.8593695 sec.
Run time: 0.859375 sec.
Space: 75499920 Bytes
GC: 144, GC time: 0.21875 sec.
[5]> (lisp-implementation-version)
"2.41 (2006-10-13) (built on Driven [192.168.0.4])"
----------------------------------------------------------------------------
LISPWORKS 5.0.2 PROFESSIONAL (Windows 32bit XP)
CL-USER 1 > (defclass a () ((x :initarg :x) (y :initarg :y) (z :initarg :z)))
#<STANDARD-CLASS A 200DE89B>
CL-USER 2 > (defun foo () (dotimes (i (expt 2 20)) (make-instance 'a :x 1 :y 2 :z 3)))
FOO
CL-USER 3 > (compile 'foo)
FOO
NIL
NIL
CL-USER 4 > (time (foo))
Timing the evaluation of (FOO)
User time = 0.171
System time = 0.000
Elapsed time = 0.172
Allocation = 33563660 bytes
0 Page faults
NIL
--------------------------------------------------------------------------
ALLEGRO 8.1 PROFESSIONAL (Windows 32bit XP)
CG-USER(1): (defclass a () ((x :initarg :x) (y :initarg :y) (z :initarg :z)))
(defun foo () (dotimes (i (expt 2 20)) (make-instance 'a :x 1 :y 2 :z 3)))
(compile 'foo)
(time (foo))
#<STANDARD-CLASS A>
CG-USER(2):
FOO
CG-USER(3):
FOO
NIL
NIL
CG-USER(4):
; cpu time (non-gc) 47 msec user, 0 msec system
; cpu time (gc) 422 msec user, 0 msec system
; cpu time (total) 469 msec user, 0 msec system
; real time 468 msec
; space allocation:
; 3,060 cons cells, 58,736,120 other bytes, 0 static bytes
NIL
--------------------------------------------------------------------------
ECL-0.9i (CVS few days ago) (Windows 32bit XP)
jb_v1.07 D:\CLOW\.systems\ecl>ecl.exe
ECL (Embeddable Common-Lisp) 0.9i (CVS 2007-10-14 10:57)
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help. Top level.
> (defclass a () ((x :initarg :x) (y :initarg :y) (z :initarg :z)))
#<The STANDARD-CLASS A>
> (defun foo () (dotimes (i (expt 2 20)) (make-instance 'a :x 1 :y 2 :z 3)))
FOO
> (compile 'foo)
;;; Loading #P"D:/CLOW/.systems/ecl/cmp.fas"
;;; Loading #P"D:/CLOW/.systems/ecl/sysfun.lsp"
;;; End of Pass 1.
;;; Note: Replacing variable G47 by its value
;;; Note: Emitting linking call for MAKE-INSTANCE
;;; Calling the C compiler...
;;; Note: Invoking external command:
;;; cl -MD -Z7 -EHsc -DGC_DLL -nologo -DECL_THREADS -O2 -I"D:/CLOW/.systems/ecl/" -w -c "C:/WINDOWS/TEMP/ECL7DB.c" -Fo"C:/WINDOWS/TEMP/ECL7DB.obj"
ECL7DB.c
;;; Note: Invoking external command:
;;; cl -Fe"C:/WINDOWS/TEMP/ECL7DB.fas" "C:/WINDOWS/TEMP/ECL7DB.obj" -LDd -MD -Z7 /link /nodefaultlib:libcmt /nodefaultlib:libcmtd /nodefaultlib:libc /nodefaultlib:libd /LIBPATH:"D:/CLOW/.systems/ecl/" ecl.lib user32.lib ws2_32.lib shell32
..lib /EXPORT:init_fas_CODE
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
/out:C:/WINDOWS/TEMP/ECL7DB.fas
/dll
/implib:C:/WINDOWS/TEMP/ECL7DB.lib
/debug
/nodefaultlib:libcmt
/nodefaultlib:libcmtd
/nodefaultlib:libc
/nodefaultlib:libd
/LIBPATH:D:/CLOW/.systems/ecl/
ecl.lib
user32.lib
ws2_32.lib
shell32.lib
/EXPORT:init_fas_CODE
C:/WINDOWS/TEMP/ECL7DB.obj
Creating library C:/WINDOWS/TEMP/ECL7DB.lib and object C:/WINDOWS/TEMP/ECL7DB.exp
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3
FOO
NIL
NIL
> (time (foo))
real time : 71.515 secs
run time : 71.391 secs
gc count : 1472 times
consed : 1870661192 bytes
NIL
.
- References:
- Reasons to choose CLISP over other free implementations
- From: Javier
- Re: Reasons to choose CLISP over other free implementations
- From: Geoff Wozniak
- Re: Reasons to choose CLISP over other free implementations
- From: Javier
- Re: Reasons to choose CLISP over other free implementations
- From: Juho Snellman
- Re: Reasons to choose CLISP over other free implementations
- From: Javier
- Re: Reasons to choose CLISP over other free implementations
- From: Juho Snellman
- Reasons to choose CLISP over other free implementations
- Prev by Date: Re: asdf-install sbcl windows
- Next by Date: Re: Reasons to choose CLISP over other free implementations
- Previous by thread: Re: Reasons to choose CLISP over other free implementations
- Next by thread: Re: Reasons to choose CLISP over other free implementations
- Index(es):
Relevant Pages
|
|