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

From: John Clements (clements at brinckerhoff.org)
Date: Sat Jul 23 14:58:56 EDT 2011

On Jul 23, 2011, at 2:46 PM, Robby Findler wrote:

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

#<s16vector>s.


John

> 
> 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
>> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4624 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20110723/88c21535/attachment.p7s>

Posted on the dev mailing list.