mansrz / pymt

Automatically exported from code.google.com/p/pymt
0 stars 0 forks source link

cpu hog #340

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
pymt is very aggressive in updating widgets/display, it should be more of an 
evented framework. only update widgets when required

Original issue reported on code.google.com by hsawh...@gmail.com on 5 Oct 2010 at 1:11

GoogleCodeExporter commented 9 years ago
This is kind of impossible, cause of our choice of OpenGL.
Try to enable vsync, or reduce the framerate if 60FPS is too much for you :)

Original comment by txprog on 5 Oct 2010 at 1:19

GoogleCodeExporter commented 9 years ago
Just to be sure, ensure you've your latest graphics drivers installed, if not, 
you may use CPU for graphics display, and then yes, it can be really slow.

And we are always trying each version to reduce the python overhead, and 
accelerate some part in C. This is a continuous work, and will never stop :) 
(check the http://pymt.eu/?page=releasenotes-0.5.1)

Original comment by txprog on 5 Oct 2010 at 1:22

GoogleCodeExporter commented 9 years ago
Sorry, it was : http://pymt.eu/?page=releasenotes-0.5

Original comment by txprog on 5 Oct 2010 at 1:22

GoogleCodeExporter commented 9 years ago
I browsed through the documents and I couldn't figure out a way to restrict fps 
via configuration or api. 

I had to induce a delay callback by inducing sleep via 

def throttle_cpu():
  def induce_delay(dt):
    time.sleep(delay)
    return True
  getClock().schedule_interval(induce_delay, 0)

but then this would also delay firing of events on the screen which would 
degrade responsiveness towards touch/mouse inputs and effects

Is there a way to handle this better?

Original comment by hsawh...@gmail.com on 5 Oct 2010 at 5:29

GoogleCodeExporter commented 9 years ago
I really liked pymt but because of cpu hungry nature, its a toll on the battery 
life of  touch tablets and netbooks. If pymt can get an evented system, it will 
be a huge win for pymt for devices where battery life is important

Original comment by hsawh...@gmail.com on 5 Oct 2010 at 6:13

GoogleCodeExporter commented 9 years ago
Yes, you have no way to control vsync right now. Vsync is by definition sync on 
the vertical sync of your screen (60 fps most of case.)

For tablet, we already got a discussion like this, and again, our choice of 
opengl rendering made impossible the fact that we can't draw only the part to 
update. (because on opengl, you always "flip" the whole screen, no way to flip 
only a part.)

Our approche will be more if "nothing" happen, stop the loop until a new input 
is coming. Then, if you're not playing animation or video, pymt will sleep. 
This is not released yet, and introduce lot of changes inside the toolkit. But 
it will come :)

Original comment by txprog on 5 Oct 2010 at 9:38