make-<some-struct> performance

Didier Verna <[email protected]> Mon, 17 Nov 2008 17:26:51 +0100
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
       Hello,

I have a question regarding the performance of structure making
functions. Suppose I have something simple like this:

(defstruct struct (slot1 1 :type fixnum))

Benchmarking a number of calls to make-struct made me realize that there
is no difference between an optimized version:

(declaim (optimize (speed 3)
		   (compilation-speed 0)
		   (safety 0)
		   (debug 0)))

and a safe version:

(declaim (optimize (speed 0)
		   (compilation-speed 0)
		   (safety 3)
		   (debug 0)))


This is quite different from other implementations I'm testing. I have
also noted that there doesn't seem to be any type checking done in the
safe version, so for instance:

(defstruct struct (slot1 1.5 :type fixnum))
(make-struct)

does not trigger a type error. This is also different from other
implementations (and maybe could explain why the safe and optimized
versions perform at the same level; because they wouldn't actually be
different).



Any comment on this ?

Thanks.

--=20
Resistance is futile. You will be jazzimilated.

Scientific site:   http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com

EPITA/LRDE, 14-16 rue Voltaire, 94276 Le Kremlin-Bic=EAtre, France
Tel. +33 (0)1 44 08 01 85       Fax. +33 (0)1 53 14 59 22