[Haskell-cafe] Performance help

Stefan O'Rear stefanor at cox.net
Tue Nov 13 17:49:52 EST 2007


On Tue, Nov 13, 2007 at 02:45:33PM -0800, Justin Bailey wrote:
> On Nov 13, 2007 2:21 PM, Ryan Ingram <ryani.spam at gmail.com> wrote:
> > Never mind, I realized this is a ring buffer with `mod` s.   That's another
> > slow operation when you're doing code as tight as this.  If you can
> > guarantee the ring is a power of 2 in size you can use a mask instead, or
> > use my original suggestion of deriving rules from the previous rule and the
> > new bit; the initial state is determined by the last bits in the buffer and
> > you never wrap.
> 
> I can't guarantee the ring is a power of 2 but do you feel like
> explaining the mask suggestion anyways?
> 
> Thanks for the bits suggestion - I'll see if that helps performance at
> all. It looks like you have to be very careful in which concrete type
> you choose or you'll get a lot of  conversion going on.

About how wide are your rules usually?

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20071113/63c0152b/attachment-0001.bin


More information about the Haskell-Cafe mailing list