Jump to content

Phaser, too much idle time on each frame


Wins
 Share

Recommended Posts

Hello!

 

In game, made on Phaser (2.1.3) is too much idle time on each frame. This causes FPS(frame per second) drop below 60.
Drawing takes minimum time, but the wait of the next frame lasts longer than necessary(have a look at white bars on the screenshot).

What causes this problem and how it could be solved?

 

 

post-6783-0-61272900-1433868743.png

Link to comment
Share on other sites

  • 3 months later...

That looks like quite a different trace, but it's not obvious to me that it's more helpful (atleast if you are still ultimately targeting WebGL for rendering). What about looking at something like Chrome's About Tracing tool? http://www.html5rocks.com/en/tutorials/games/abouttracing/

I've also got a hunch that Phaser's rAF callback could be improved by only drawing in the call, and using a setImmediate/postMessage call to call the update code only after yielding. I stress this is only a hunch (I haven't even tried to benchmark/prove it) but I imagine that returning from rAF calls sooner may help.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...