Jump to content

PixiJS performance while idle seems bad


ZenBlender
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 2 months later...

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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