[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] High CPU usage drawing static boxes
- To: pygame-users@xxxxxxxx
- Subject: [pygame] High CPU usage drawing static boxes
- From: João Pinto <lamego.pinto@xxxxxxxxx>
- Date: Sat, 2 Apr 2011 15:42:26 +0100
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sat, 02 Apr 2011 10:42:32 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=6+kEOXbzbgMNVC1+qeWjILlHYuPO7CFal0ymVfmQi1w=; b=V4zj0cvaLV5rrNasnT8ijXROvVRBKYkN1mUrRT3UpRCefxZ6iXDnUsc8cjboMHv4cH 6SHQF22wECR2v8S39XgxPIiXlB8lueo34OTAroU4cK84TtnVoOZyvQ3peeIy5lAhzzgE +7CwPG5yN7YtRzLo/QHzQGEK4Cw8LFv1Hetgg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=p+UtyIwSexzhHCh790gOoiOxUULyghNDPa5n15oDf8Bz3glZHVl2iQHrmfi5RM4RIv W2dAdu85ohLJviu7P+PLNv6sP/Do+MN2nIe2YHqsVFox2PRtLvq8ZAeMT/Y3AltST5yv 3QCe7FYipOPWoBomyRGJabiYVDq5L8q4jcqM0=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hello,
I have just recently started to experiment with pygame.
I have created some code to show some letter boxes, strangely it's using 30-40% of one core on my laptop, something that I would not expect for such trivial code.
I am familiar with the implications of the pygame event loop, I am using Clock.tick(FPS) which I believe should avoid the high cpu usage.
My code is available from:
https://www.dropbox.com/s/oxyyzhlsu16ej95/wpop.tar.gz
Run it with: python main.py
Can someone provide me an hint about the reason for the high cpu usage and how to minimize it ?
Thanks
--
João Pinto
IRC: joaopinto @ irc.freenode.net
Jabber ID: lamego.pinto@xxxxxxxxx