Hi John,<br><br>Thanks for that suggestion.<br><br>I tried replacing my matrix with a numpy array, and it was about 20% slower, but I just substituted one for the other, so that really isn't surprising.&nbsp; I didn't try with the built-in array, but I'm guessing that swapping out another container for lists would only have a chance of speeding it up by a constant amount, I think, since setting and getting list elements is O(1).
<br><br>
Having said that, I forgot arrays existed.&nbsp; I will take a look right now, and look at their methods, see if there is anything in there I can dig up to help above and beyond a new container.<br><br>I think, conceptually, I need to make the sliding window more efficient by not getting overlapping elements repeatedly, or maybe figuring out a way to skip the conversion from bits to integers.&nbsp; I tried storing as strings, and doing a join to get 
i.e. &quot;110&quot; and using that as a key to look up 1 or 0, but it was miserably slow :)<br><br>The ~15x speedup from psyco makes me think if there was a built-in function that could handle everything in one fell swoop with tight C code, that would probably speed it up a -lot-.&nbsp; But I haven't found anything like that for a sliding window type situation.
<br><br><br><div><span class="gmail_quote">On 9/18/05, <b class="gmail_sendername">John Fouhy</b> &lt;<a href="mailto:john@fouhy.net">john@fouhy.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 19/09/05, grouchy &lt;<a href="mailto:grouch@gmail.com">grouch@gmail.com</a>&gt; wrote:<br>&gt; I've been playing with generating 1-D cellular automata, and this is the<br>&gt; fastest solution I've come up with so far.
<br><br>I haven't dug deep into your code --- but, I wonder if the array<br>module might help?<br><br>--<br>John.<br>_______________________________________________<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Tutor@python.org">
Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br>