Wins Posted June 9, 2015 Share Posted June 9, 2015 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? clark 1 Link to comment Share on other sites More sharing options...
Skeptron Posted June 10, 2015 Share Posted June 10, 2015 Very interesting observation. Would love to see an explanation here too! Link to comment Share on other sites More sharing options...
Wins Posted September 13, 2015 Author Share Posted September 13, 2015 The answer found!This situation happens when game uses GPU for render, and the CPU waiting when GPU calculation will be completed. This white bars show what the renderer thread was busy.More information - https://plus.google.com/+NatDuca/posts/BvMgvdnBvaQ?e=-RedirectToSandbox clark and drhayes 2 Link to comment Share on other sites More sharing options...
Skeptron Posted September 14, 2015 Share Posted September 14, 2015 NICE! So what now? Force Canvas? Link to comment Share on other sites More sharing options...
Wins Posted September 19, 2015 Author Share Posted September 19, 2015 NICE! So what now? Force Canvas? Yes, when I used CANVAS mode on new Phaser.Game(...)- profiler shows correct information, without big idle time on each frame. Link to comment Share on other sites More sharing options...
chg Posted September 19, 2015 Share Posted September 19, 2015 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 More sharing options...
Recommended Posts