Re: [pygame] Rotation Performance

2010-01-21 Thread Brian Fisher
.2 seconds to rotate an image sounds ridiculously long - that sounds broken. Are you sure it can take that long just to do the rotation? How big is this image? Can you share a minimal sample (like 1 file + the image) that does the rotations and prints out the timings, which goes really slow for

Re: [pygame] Rotation Performance

2010-01-21 Thread Bram Cymet
Thanks everyone for the help. I used the suggestion of caching the rotations and that works really well. On 01/21/2010 11:55 AM, Brian Fisher wrote: .2 seconds to rotate an image sounds ridiculously long - that sounds broken. Are you sure it can take that long just to do the rotation? How

[pygame] Rotation Performance

2010-01-20 Thread Bram Cymet
Hi All, I did some profiling of my pygame application and I found that it was spending a lot of time doing rotation operations. Basically I have some balls on the screen that are represented by gifs with transparent backgrounds and I want to make them spin. I use the following code: These

Re: [pygame] Rotation Performance

2010-01-20 Thread Shandy (Andy) Brown
Image processing commands are expensive. Best to precalculate all the rotations. Also, since it's probably regular CPython you're running, there's only ever one thread running at a time. If you're using threads, you're probably doing something wrong. On Wed, Jan 20, 2010 at 5:08 PM, Bram Cymet

Re: [pygame] Rotation Performance

2010-01-20 Thread Ian Mallett
On Wed, Jan 20, 2010 at 6:06 PM, Shandy (Andy) Brown sjbr...@geeky.netwrote: Image processing commands are expensive. Best to precalculate all the rotations. Indeed. Precalculate, cache, and generally avoid image processing in SDL.

Re: [pygame] Rotation Performance

2010-01-20 Thread Luke Paireepinart
Also, since it's probably regular CPython you're running, there's only ever one thread running at a time. If you're using threads, you're probably doing something wrong. I think what he means is that - don't assume that just because you have 2 threads they will run on both cores. What

Re: [pygame] Rotation Performance

2010-01-20 Thread Jake b
Hello. You don't need to worry about creating threads for this app. On Wed, Jan 20, 2010 at 7:08 PM, Bram Cymet bcy...@cbnco.com wrote: Hi All, I did some profiling of my pygame application and I found that it was spending a lot of time doing rotation operations. Basically I have some

Re: [pygame] Rotation Performance

2010-01-20 Thread Casey Duncan
Some thoughts: - You might try using rotozoom, which probably isn't faster, but will give you much better quality. - Don't rotate a single image/surface multiple times, as rotation is lossy, and will make the surface grow much larger than necessary. Instead only rotate from the original image

Re: [pygame] Rotation Performance

2010-01-20 Thread B W
It could just be the Atom. http://www.trustedreviews.com/cpu-memory/review/2008/08/14/VIA-Nano-vs-Intel-Atom/p3 Gumm