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 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 you?
> If you do that, then others can run it as well to see if they get the
> same slowness you do.
>
>
> On Wed, Jan 20, 2010 at 5:08 PM, Bram Cymet <bcy...@cbnco.com
> <mailto: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
>     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 first two lines are only run in init for the object
>         self.image = pygame.image.load('image.gif')
>         self.image = self.image.convert()
>
>      self.image = pygame.transform.rotate(self.image, degrees)
>      self.rect = self.image.get_rect()
>
>     Then I return the rect and blit and update that part of the screen. A
>     lot of time is spent on that pygame.transform.rotate command. On my
>     laptop with a dual core 2.2 ghz processor if works fine. However
>     on the
>     target hardware which is:
>
>     Atom 330 (dual core 1.6 ghz) with an ION chipset and graphics
>
>     it runs very slow and can take up to 0.2 seconds to execute just that
>     one line of code.
>
>     Is there something I am doing wrong? Is there some way I can make this
>     faster.
>
>     I am not sure if it matters but just for the sake of completeness: the
>     application is multi-threaded but only one thread is running
>     during this
>     part of the application.
>
>     Any help would be great.
>
>     Thanks,
>
>     --
>     Bram Cymet
>     Software Developer
>     Canadian Bank Note Co. Ltd.
>     Cell: 613-608-9752
>
>
>


-- 
Bram Cymet
Software Developer
Canadian Bank Note Co. Ltd.
Cell: 613-608-9752


Reply via email to