Jump to content

Horrible performance in PixiJS v4


Mezei
 Share

Recommended Posts

In short, I've just recently updated the html5 app I'm working on to use the newest version of Pixi (v4) recently. It looked nice & all and it basically didn't break anything.
(Well, except for a ColorMatrixFilter because v4 for some reason has a padding attribute set as default to 4.)

Anyway, I was really happy with the new promises such as WebGL renderer mobile optimizations and I quickly compiled my project (using Cocoon.io) to an Android apk to test.
Well saying that it ran slower is an understatement. Gameplay parts where the previous Pixi v3 provided an estimated 50-60 fps, this struggled to get 20-30.

I made some other changes to the code so I wasn't sure if it was the update's fault at first, but I quickly reverted to v3 and regained the old and much better performance.

Some info:
- I'm probably not using any SpriteBatches
- I'm initializing the renderer as this: renderer = new PIXI.WebGLRenderer(window.innerWidth, window.innerHeight);
- I'm drawing a lot of Sprites with different sizes at the same time, maybe 100 at max
- A lot of the above Sprites are visibility/alpha toggled many times during gameplay, but I do not store them outside the render area
- I'm using manual scaling on a lot of Sprites individually, I just rarely scale a container

Well, that's all I could think of right now. The strange thing is that v4 actually seemed to run faster on desktop (Firefox).
 

Link to comment
Share on other sites

Sounds highly likely to be an issue with the v4 and Cocoon combo specifically, rather than v4 in general. Even though you aren't taking advantage of sprite batching, you can't be doing much wrong if v3 runs at 60fps, it has to be something internal that Cocoon doesn't like. So good luck debugging that :) Maybe it'd be safer to just remain with v3 for this game and give v4 time to mature?

Link to comment
Share on other sites

Thanks for the quick response rich and I very much agree with you about those!

We'll surely keep v3 for our current project, I just hope other Pixi/Cocoon developers will keep an eye out aswell!
I'll probably forward this topic to the guys at Cocoon.io so they can have a look at it instead of me! ;)

It really must be something that their in-house browser doesn't like about v4. I hope they'll fit eventually! :)

Link to comment
Share on other sites

At a hunch I'd say you could probably boil it down to a quite minimal test case. Or you could just wait it out - there are surely other devs wanting to use v4 and Cocoon, so this is bound to rear up at some point (unless it is specific to your game only of course, in which case creating a test case would both rule that out, and give much needed info to the Pixi and Cocoon devs, so it's kind of a double-win either way)

Link to comment
Share on other sites

On May 8, 2016 at 6:05 PM, rich said:

 Maybe it'd be safer to just remain with v3 for this game and give v4 time to mature?

I agree - for anyone out there doing production work with Pixi, I'd stay with v3.0 (which is great!!) until v4.0 is road tested a little longer. 

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...