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

Re: [pygame] 99 CPU use?



I recently wrote a pygame app that did this.  I wanted a 900x900 screen,
and the loop was just killer on the CPU, I took out the screen drawing
from the loop and just drew when there was a new event.  Now the CPU usage
is basically 0%.

I thought it was interesting.  Check the Twister Referee I posted to the
list a couple weeks back.

Of course, this is only doable on certain kinds of games.

> You might also look at how you're polling events and see if you can
> choose a method that is less intense. No need to keep looping if you can
> just stop and wait for the next event. You might try to cut back on how
> much you're drawing to screen each frame. See if you can update only
> part of the screen each pass and possibly only update changes every
> couple passes.
>


----
Sent from geeky.net