hi

somehow related to this post from last month
http://groups.google.com/group/pyglet-users/browse_thread/thread/8bab298bd8f7f32a/eaaa998b5e973d99?lnk=gst&q=schedule_interval#eaaa998b5e973d99

i noticed that CPU usage goes up when the mouse is moved, no matter if
on_mouse_motion is declared or not. In a simple example i am working on 
it goes up from 5% to 15%. The frame rate goes up as well from 35 to 75 fps.

I noticed that if I write my own event loop replacing pyglet.app.run() by

while True:
     pyglet.clock.tick()
     for window in pyglet.app.windows:
         window.switch_to()
         window.dispatch_events()
         window.dispatch_event('on_draw')
         window.flip()

kind of solves this, i get a consistent CPU usage of 14% no matter if i 
move the mouse or not. However the CPU usage increases and i dont like 
this. I also experimented with limiting the framerate with 
pyglet.clock.set_fps_limit(30) and it is even worst. It boosts the CPU 
of my example to ~50% with a constant rate of 30 fps. So looks like 
there is no much i can do. The built in loop seems to be as efficient as 
it can get and gaining control over it means loosing efficiency.

It is funny that in pygame is the other way around, increasing the 
framerate over 20 fps boosts CPU to 99%

I also noticed that the problem with the CPU boosting when mouse is 
moved stops if i use
pyglet.clock.schedule(update)
instead of
pyglet.clock.schedule_interval(update, 1/15.)
again the CPU goes up to 13% with the fist while the second achieves ~7%

ideally i would like to have the lowest CPU use possible, if anyone has 
any suggestion about how to go about this in relation to the ideas I 
write in this post, they will be welcome!

Not sure if all this makes any sense, i could provide examples if anyone 
is interested.

thanks

enrike


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to