[racket-dev] can we write these four lines of C in performant racket?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat Jul 23 14:46:36 EDT 2011

What is the data you're using to represent the shorts in Racket?

Robby

On Sat, Jul 23, 2011 at 1:42 PM, John Clements
<clements at brinckerhoff.org> wrote:
> This C code adds the content of one buffer to another one, with no checking.  The corresponding racket code runs about 10x slower. Do you folks think that it should be possible to do better? (One salient fact: these are shorts--16-bit-ints--not 32-bit ints.)
>
> John
>
>
>
> void addOn(short *dst, int dstOffset, short *src, int srcOffset, int len) {
>  int i;
>  for (i = 0; i<len; i++) {
>    dst[i+dstOffset] += src[i+srcOffset];
>  }}
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>



Posted on the dev mailing list.