From: Ilmari Heikkinen Date: 2007-09-25T03:32:39+09:00 Subject: Re: I am new to Ruby and I could use some expert advice as to how I can make this code run faster. On 9/24/07, Joel VanderWerf wrote: > On 9/24/07, Ilmari Heikkinen wrote: > ... > > And here's a C version: > > To give C its fair due, you might try with > > unsigned long *buf; > > and > > buf[i] |= 0x80808080; > > (and the other necessary changes, of course). > > -- > vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 I tried that a while ago, it was roughly twice as fast as the per-byte version. But it had a bug with the last % 4 bytes and I wasn't hardcore enough to bother fixing it. And a version with 64-bit ints was even faster. But it had a bug too. Anyone wish to contribute working versions :)?