Re: list, vectors, and stucts
- From: "S. Robert James" <srobertjames@xxxxxxxxx>
- Date: 1 Mar 2007 11:40:22 -0800
Let's simplify the question:
Is there anyway to make-array and specify all of the initial values
without having to make any intermediate data structures like lists?
On Mar 1, 1:14 pm, "S. Robert James" <srobertja...@xxxxxxxxx> wrote:
My algorithm uses lots of (never modified) 3 element lists of small (<
2^8) pos. integers.
Originally, I implemented these as lists. I switched to defstruct to
improve speed. Looking at the dissasembly, I see that access is quick
as can be, but that creating them still involves some expensive calls
to the generic structure creation routines.
I'd like to try implementing them as short arrays. However,
(vector 3 4 2)
creates arrays of simple-vector, which performs _much_ slower - I
assume since it doesn't know that the elements are integers.
I've tried:
(make-array 3 :element-type '(unsigned-byte 8) (vector a b c))
but that doesn't seem to work right either.
What's the right way to create these structures efficiently?
.
- Follow-Ups:
- Re: list, vectors, and stucts
- From: Zach Beane
- Re: list, vectors, and stucts
- References:
- list, vectors, and stucts
- From: S. Robert James
- list, vectors, and stucts
- Prev by Date: Re: Handling SLIME/Emacs requests in a SDL program (Interactive development)
- Next by Date: Re: For McCarthy's sake !
- Previous by thread: Re: list, vectors, and stucts
- Next by thread: Re: list, vectors, and stucts
- Index(es):
Relevant Pages
|