ZenBlender Posted September 4, 2020 Share Posted September 4, 2020 For my game project, I've only only implemented a small amount of animation so far, but was noticing that even with my high end 16" Macbook Pro from just last year, the simplest of PixiJS applications can cause the fans to come on, even when my game is only covering 1/4 of the screen. That seems a bit odd. I looked in Activity Monitor and I see Google Chrome Helper (GPU) will be using around 16% CPU and Google Chrome Helper (Renderer) around 11%. Fans are clearly audible, which seems extreme. Besides the distracting noise, I'm concerned about battery life. So then I simplify things as much as I can and basically have a game with just a static texture. Same CPU/GPU usage. Then I confirm that there are no animate functions attached to the ticker. Same result. I'm using react-pixi-fiber but it appears that this is not a factor since again, I'm not running any animate functions. I've looked at some of the simplest PixiJS examples, and the same situation exists. Consider this one, which has no animation and just a click handler: https://pixijs.io/examples/#/interaction/click.js Why does simply having this on screen cause ~16% GPU and ~11% CPU and my fans blowing air? This one has no interactivity but is only slightly better: https://pixijs.io/examples/#/graphics/simple.js (Of course my game will have some interactivity though) When I look at the performance profiler results, I see the ticker periodically firing, but the effect on my machine isn't inspiring. Is there anything that can be done? I feel like I can't get to the "performance optimization" stage of development when my game is already going to be eating up battery life before I even implement anything. Sorry for the venting, but would really appreciate some help, thanks! Quote Link to comment Share on other sites More sharing options...
b10b Posted September 4, 2020 Share Posted September 4, 2020 Perhaps run similar tests on a complex project and compare the difference to the simple project. The performance cost / benefit may become apparent (in comparison to alternatives) the more you add to the plate? Quote Link to comment Share on other sites More sharing options...
ZenBlender Posted September 4, 2020 Author Share Posted September 4, 2020 In other words, perhaps there is a default CPU/GPU hit to simply having PixiJS, but perhaps that won't worsen significantly as a lot of functionality / complexity is added? Quote Link to comment Share on other sites More sharing options...
b10b Posted September 4, 2020 Share Posted September 4, 2020 23 minutes ago, ZenBlender said: In other words, perhaps there is a default CPU/GPU hit to simply having PixiJS, but perhaps that won't worsen significantly as a lot of functionality / complexity is added? That is certainly my experience - performance is often split into a fixed-component and a marginal-component that scales with complexity. Or, we should consider that an "idle" Pixi application isn't actually idle. I would also question whether there is something up with your rig to cause the minimum application to create an observable performance burden? But by running the complex test and making a comparison you may be able to separate these speculations? Quote Link to comment Share on other sites More sharing options...
themoonrat Posted September 4, 2020 Share Posted September 4, 2020 Have you tried setting transparency to true when creating the renderer? A lot of people have noted it gives a big boost to performance, for some reason, with Intel GPUs. By default it is false Quote Link to comment Share on other sites More sharing options...
b10b Posted September 4, 2020 Share Posted September 4, 2020 5 minutes ago, themoonrat said: Have you tried setting transparency to true when creating the renderer? A lot of people have noted it gives a big boost to performance, for some reason, with Intel GPUs. By default it is false Interesting ... is there any reported downside to this? For example, should we all just do this by default, regardless of whether we've personally encountered performance issues or not? Quote Link to comment Share on other sites More sharing options...
ZenBlender Posted September 4, 2020 Author Share Posted September 4, 2020 Thanks, I tried enabling transparency for the renderer but it has no apparent effect on the CPU/GPU usage on my Macbook. Quote Link to comment Share on other sites More sharing options...
themoonrat Posted September 4, 2020 Share Posted September 4, 2020 3 hours ago, b10b said: Interesting ... is there any reported downside to this? For example, should we all just do this by default, regardless of whether we've personally encountered performance issues or not? No downsides that I know of, or on games I've released. https://github.com/pixijs/pixi.js/issues/6853 got the potential to make it true by default for pixi V6, and examples for other libs like three where a certain setting to WebGL is just slow on certain intel gpus Quote Link to comment Share on other sites More sharing options...
ZenBlender Posted September 13, 2020 Author Share Posted September 13, 2020 An interesting discovery: In my latest simple test, where I have a few objects in my scene but only one small AnimatedSprite, Safari shows ~6% CPU usage in Activity Monitor. For the exact same test but in Chrome, I see the Renderer process taking up ~12% with the GPU process taking up an additional ~12%. Has anyone else noticed big differences in CPU/GPU usage when switching browsers, or have an idea about improving Chrome specifically? I am using transparent mode, which hasn't had any performance effect in either browser. Quote Link to comment Share on other sites More sharing options...
dpaola2 Posted November 28, 2020 Share Posted November 28, 2020 Hello, I am also seeing this issue with my Pixi app. Unfortunately I'm running it in an ElectronJS container so switching away from Chrome is not an option. I'm actually considering switching away, since the CPU usage is so high even when idling. Oddly enough, the Chrome performance benchmarking shows very little happening when idle - it's very puzzling, since the rendering process that contains Pixi is "idling" at such high CPU. Have you made any progress? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 28, 2020 Share Posted November 28, 2020 > Why does simply having this on screen cause ~16% GPU and ~11% CPU and my fans blowing air? Macs + WebGL = goodbye silence. Its not PixiJS problem, this thing existed for all macbooks. Try ThreeJS or Phaser - you'll get the same result. Even specifying something like "power-preference" parameter in renderer/context params helps only a bit. Both "antialias:true" and "resolution: devicePixelRatio" or "resolution:2" options should be in app settings with page refresh, because its not clear whether user really wants his mac to fly away on its coolers. Quote Link to comment Share on other sites More sharing options...
ZenBlender Posted November 28, 2020 Author Share Posted November 28, 2020 Thanks Ivan, Can you please elaborate a bit on this? 5 hours ago, ivan.popelyshev said: Both "antialias:true" and "resolution: devicePixelRatio" or "resolution:2" options should be in app settings with page refresh Are you suggesting these options improve things for Macs? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 28, 2020 Share Posted November 28, 2020 those options people like to use, but on macs its extra problem. I mean that you have to make those things available for users. Its user problem whether to enable them on their computer. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.