[CM] most efficient way to map over a vector?
iainduncanlists at gmail.com
Sun Apr 3 10:06:13 PDT 2022
Thanks Elihah, that's basically what I'm doing.
Is there a speed advantage to using float-vector-set! over plain old set! ?
On Sat, Apr 2, 2022 at 5:47 PM Elijah Stone <elronnd at elronnd.net> wrote:
> Sorry, should be
> (do ((i 0 (+ 1 i))
> (l (length v)))
> ((>= i l))
> (float-vector-set! v i (f (float-vector-ref v i))))
> On Sat, 2 Apr 2022, Elijah Stone wrote:
> > Probably:
> > (do ((i 0 (+ 1 i))
> > (l (length v)))
> > (>= i l)
> > (float-vector-set! v i (f (float-vector-ref v i))))
> > Obviously substituting int-vector-* or byte-vector-* if appropriate.
> > That said, if performance is really important, I might just write the
> code in
> > c.
> > On Sat, 2 Apr 2022, Iain Duncan wrote:
> >> Hi all, I'm mapping some transforms over vectors in a part of the code
> >> I need to have run as efficiently as possible. I'm hoping someone can
> >> me what the fastest running approach to this is. I would like to leave
> >> data as vector as it is used in a framebuffer at the C level.
> >> thanks!
> >> iain
> > _______________________________________________
> > Cmdist mailing list
> > Cmdist at ccrma.stanford.edu
> > https://cm-mail.stanford.edu/mailman/listinfo/cmdist
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cmdist