Pixi.js: [Question] How to reduce Idle time?

Created on 18 Oct 2016  路  10Comments  路  Source: pixijs/pixi.js

I'm running a 3 minutes animation that synchronizes PIXI with an HTML5 video, on average the frame rate hovers around 58 - 60 FPS.

But in the middle of the animation, the browser suddenly goes into an idle mode which took around 1 - 0.5 seconds.

Looking at the timeline, there's no indication that the browser is GC'ing something or any other bottleneck.

screen shot 2016-10-18 at 11 49 36

And on further inspection, I've found Paul Iris' video, and he said Chrome will wait for the GPU to clear itself at certain times and there's nothing that the developer can do about it.

If that's the case is there, at least, some way to reduce the time? because 0.5 seconds is a noticeable pause.

  • Chrome 54.0.2840.59
  • MacOSX 10.11.6
  • Pixi.js 4.0.3
馃 Question

Most helpful comment

We've discovered the issue! apparently, it was the GC maxIdle time.

https://github.com/pixijs/pixi.js/blob/master/src/core/renderers/webgl/TextureGarbageCollector.js#L21

After extending it to 4 minutes, it went smoothly without any hiccups.

All 10 comments

Usually "idle" in the dev tools just means there is nothing to do, so it does nothing. There are cases however where the browser needs to synchronize with the GPU process and block to do so. I'm not sure there is anything you can do about it though.

I see, thank you for the reply, I wonder if it depends on the computer as well.

It absolutely does, there are many many things that can affect it:

  • Browser
  • Browser version
  • CPU
  • GPU
  • GPU Driver version

If those time periods truly are Idle and not GC, then there isn't anything you can do to shorten it. Similar to your OS, the "idle" time is just the placeholder process that runs on that core when nothing is running:

image

Chrome is the same way, normally I read that graph you sent as "the code I had here was extremely fast, and the browser was just idle for most of this time".

Thank you for the fast response, incidentally, PIXI is a great product.

We've discovered the issue! apparently, it was the GC maxIdle time.

https://github.com/pixijs/pixi.js/blob/master/src/core/renderers/webgl/TextureGarbageCollector.js#L21

After extending it to 4 minutes, it went smoothly without any hiccups.

@bebensiganteng were you able to set this directly on the renderer instance, or did you have to modify the constructor?

We have a short deadline so we had to modify the PIXI class directly.

So the stalls were coming from the TextureManager cleaning up textures that it thought was unused?

@bebensiganteng - just following up here, don't know if you saw this, looks like MAX_IDLE is a setting in the latest release - https://github.com/pixijs/pixi.js/pull/3305

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YuryKuvetski picture YuryKuvetski  路  3Comments

zcr1 picture zcr1  路  3Comments

readygosports picture readygosports  路  3Comments

MRVDH picture MRVDH  路  3Comments

lunabunn picture lunabunn  路  3Comments