staff0rd Posted March 5, 2016 Share Posted March 5, 2016 When I open this phaser example on Chrome, Windows 10 on a Surface Pro 3 (i7, 8GB RAM), my CPU usage jumps from about 2% to about 25% and stays there. This leads me to believe that running phaser will at a minimum use 20-25% of my CPU, and that's before I add anything like animations and sounds, physics, and anything in an update() method. Running this PIXI example shows CPU pegged at about 11%. I understand that Phaser is providing much more than just rendering, but I can't help think that when it's using at a minimum double the CPU of the renderer when idle that something is off. Is this what everyone else is finding? Is this just the cost of using Phaser? There are other threads that have optimization tips regarding limiting the amount of tweens and sprite reuse and physics etc, but are there any tips folks can share for optimizing when none of extra features are being used such as in the phaser example above? Link to comment Share on other sites More sharing options...
SignalSin Posted March 5, 2016 Share Posted March 5, 2016 Hmmm... that's not what I'm experiencing. I've got a Core i3-4130 and with my Phaser game open and running plus a few other applications, CPU usage hovers around 6%. I get the same thing running the PIXI example that you've linked. Link to comment Share on other sites More sharing options...
rich Posted March 5, 2016 Share Posted March 5, 2016 I suggest you compare them like-for-like, so don't run the Example in the page, where it's running in an iframe with all the other trappings the page has around it (code editor, Disqus, Analytics, etc). Just run the example on its own, doing nothing else. I would then expect very similar CPU use to the Pixi example, maybe a little higher because of things like the Input manager and Scale manager, but not much. Just don't under-estimate how much all the other stuff on the page takes up (an using an iframe too) Link to comment Share on other sites More sharing options...
staff0rd Posted March 6, 2016 Author Share Posted March 6, 2016 Ran the tests on my desktop (higher spec i7 + 16GB RAM); Found CPU to hover at; Example page: 3-4% Example page direct - 2-3% PIXI example - 2-3% Most importantly I ran my full Phaser game on this rig and found it to also be running at 3-4%! Looks like the Surface may be to blame, although I probably still need to find some more lower spec machines to test it on. Link to comment Share on other sites More sharing options...
staff0rd Posted March 6, 2016 Author Share Posted March 6, 2016 I did some further tests on the Surface Pro (Intel Core i7-4650U @ 1.70GHz 2.30 GHz, 8GB RAM) @rich was correct in that the larger definitely DOM adds work for the CPU, so I've excluded that and only used the direct Phaser example in the following. The test setup was browser of half the screen, task manager on the other half. All values are total CPU %. The values next to the browser name is the total % CPU usage with one tab (this post) open. The following values are with two tabs - this post, and the test which is the active tab. I ensured all other browsers were completely closed (ie: chrome) prior to testing a new browser. Game values are for my in-development game. Results; IE 11.103.10586.0 (0-1) Phaser (5) Pixi (5) Game (11-15) Microsoft Edge 25.10586.0.0 (0-1) Phaser (7-8) Pixi (4-5) Game (9-13) Chrome 48.0.2564.116 m (1-2) Phaser (13-14) Pixi (8) Game (14-18) Firefox 44.0.2 (0-1) Phaser (10) Pixi (6) Game (14-18) Needless to say I am shocked by the IE11 results. I additionally tested Chrome (my main browser) with all extensions disabled, but that only dropped the results by about 0.5%. Link to comment Share on other sites More sharing options...
staff0rd Posted March 6, 2016 Author Share Posted March 6, 2016 Same tests on desktop (Intel Core i7 860 @ 2.8GHz 2.79GHz, 16GB RAM). The variances in browser here are negligible. One note for the desktop is that it has a dedicated graphics card where the Surface Pro 3 does not. Results; IE 11.0.10240.16431 (0-1) Phaser (1) Pixi (1) Game (2-4) Microsoft Edge 20.10240.16384.0 (0-1) Phaser (1) Pixi (1) Game(2) Chrome 48.0.2564.116 (0-1) Phaser (2) Pixi (1-2) Game (2-4) Firefox 43.0.1 (1-2) Phaser (2) Pixi (1-2) Game (2-4) I think I might go to the Microsoft store and run these tests against Surface Pro 4, and the Surface Book that's got the graphics card. Link to comment Share on other sites More sharing options...
Recommended Posts