[Haskell-cafe] Optimizing cellular automata evaluation (round 2)

Felipe Lessa felipe.lessa at gmail.com
Thu Nov 29 19:45:45 EST 2007


On Nov 29, 2007 10:31 PM, Justin Bailey <jgbailey at gmail.com> wrote:
> I represent the automata as an array of integers, where each bit
> represents a cell.

Why don't you use an UArray of Bools? They're implemented as bit
arrays internally, AFAIK (e.g. see
http://www.haskell.org/haskellwiki/Shootout/Nsieve ). And then you
would get rid of a lot of shifts and masks in your code -- clearer and
faster, the Haskell Way (TM).

Well, I guess it would be faster, but I can't really tell. Could you
provide a main function implementing an "use case" for benchmark?

Good luck.

-- 
Felipe.


More information about the Haskell-Cafe mailing list