[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Need help with Surfarray
I've actually had to decide on using SWIG to make this project
work. I've been talking w/ philhassey on the mirc chat, and we
were talking about his fractal tetris
http://www.imitationpickles.org/ftetris/ , and because of the
limitations of Python when it comes to huge iterations (aka my 64000
loops for a plasma generator) like for his fractal generator, you just
have to use a .c source and do it that way. I actually got the
speed from about 1/10 fps up to probably 2 fps by optimizing
calculations: declaring ashiftl = (a << 1) before the loop and
using ashiftl instead for calculations, making a list of E and F before
the for loop so the calculations would only have to be done 520 times,
and a few other tricks, but python STILL had a sheet fit about the
whole thing.
-great language, SLOW iteration calls, I dont even want to see a massively recursive function
On 10/5/05, Peter Shinners <
pete@xxxxxxxxxxxx> wrote:On Wed, 2005-10-05 at 14:40 +0900, Guillaume Proux wrote:
> I tried it but it did not help me much. Maybe i don't know enough about
> psyco to know how to properly use it.
I don't think psyco can work well when data is stored inside Numeric
arrays. I'm pretty sure it can only optimize pure python containers.