Edi Weitz <[EMAIL PROTECTED]> writes:

> Bob Koutsky <[EMAIL PROTECTED]> writes:
> 
> >   (dice  (make-array num :initial-element 0 :element-type 'fixnum))

> If you replace all occurences of AREF with SVREF you should see a
> significant performance increase.

But unfortunately, doing so would be illegal :-)  SVREF can only be
used on vectors that are simple and /not/ specialized (general
vectors).

> With AREFs you must be more specific in declaring their type in
> order to help the compiler. I think it can only optimize access to
> certain types like
> 
>   (SIMPLE-ARRAY (UNSIGNED-BYTE 4) (*)).

Yes, but AREF should be really good then; and the type should match
the element-type given when creating the vector, of course.  It is
important to give the information that the array is simple,
one-dimensional and specialized to <whatever>.  Then AREF should be
just as good as SVREF.

Regards,
-- 
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x0655CFA0


Reply via email to