[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Pygame 1.8.1 blits under Windows slower than 1.8.0?



I wrote a little demo that blits a tiled scrolling background along
with some sprites bouncing around. It also measures the time it takes
to display each frame and displays the timing info in the window's
title bar every second. When running with Python 2.5 and Pygame 1.8.0
under Windows XP, my demo measures about 0.7ms to render a single
frame in a 640x480 window using SWSURFACEs.

However, after I installed Pygame 1.8.1 using the precompiled binary
("pygame-1.8.1.win32-py2.5.msi"), my demo now reports 7.37ms rendering
time per frame. That's a 10x slow down.

Can anyone confirm if this slow down is happening on other Windows
machines (and other Pygame programs)? Or am I doing something really
stupid in my code that causes this?

You can download my little demo from:
http://code.google.com/p/game-game/source/browse/#svn/trunk/experiments/pygame

You'll need the following files:
swsurface-linear.py
tile.png
ball.png
palette.png

When you run swsurface-linear.py, the window's title bar will look
something like this:
640x480   Drawing: 7.37ms (67.6%)   Display: 91.7fps   Virtual:
20.0fps

The "Drawing" is the average time per frame and the percentage is
computed as actual rendering time over total available time per frame
(about 10.9ms for 91.7fps).