Jump to content

How much faster is phaser3?


jjwallace
 Share

Recommended Posts

Hi guys, I have built a bunch of games in Phaser2 and now i am working with PixiJs since we can render 20,000 + entities on the screen and animated them.  PixiJS lacks a lot of features.  

So, How fast is Phaser3?  Does it render as many objects as PixiJS 4?

Anyone have experience using all 3?

Link to comment
Share on other sites

On WebGL, unless the engine does something really silly, it mostly comes down to fillrate (amount of pixels you push), and amount of data the CPU needs to prepare. That depends on the rendering pipeline. Usually it's much more worth it to send a lot of data, so it is flexible. The synthetic benchmarks that just try to spawn as much as possible don't really tell much about real-world performance.

In either case, here's example from phaser that uses special object optimized for performance (doesn't send as much data to the gpu, but can't rotate/scale the objects). For me it doesn't slow down at all at 20k.
http://labs.phaser.io/view.html?src=src\game objects\blitter\benchmark test 3.js

I don't have experience with pixi, but knowing how Phaser 3 works, I would be quite surprised if pixi was substantially faster in anything. I would expect them to be similar, or pixi slightly worse. Of course Phaser being a whole game framework, there is some extra overhead, but definitely nothing that could cause problems.

Link to comment
Share on other sites

They get rendered, although there is a way to cull them if you want (not always faster though, as it needs to figure out which are in bounds, but you can always make your own culling that would be faster if possible).

No idea about fillrate of off-screen stuff. They do get send to GPU for rendering, but the actual fragments won't get rendered if they are outside, so I would reckon it won't affect fillrate. But I'm just guessing.

Link to comment
Share on other sites

  • 4 weeks later...
3 hours ago, mattstyles said:

This is where benches are really tricky to get correct.

For complex graphics I get Phaser 3 nearly twice as fast as Pixi (and Phaser 2 couldn't handle 10k at all). Pixi 5 was also way way slower than Pixi dev.

 

Pixi 5 alpha I should remove really. Webgl Anti aliasing is accidentally always on, so kills performance. Dev is v5 with that fixed!

Link to comment
Share on other sites

1 hour ago, Antriel said:

Synthetic benches aren't very useful when it comes to big numbers. It all comes down to how the pipeline is setup, which is usually based on real-world uses and not optimizing for benchmarks.

True. I'd love someone to create a PR that would create a more realistic scene in all renderers to use as a comparison.

As it is, each one has strengths in different areas. The only consistent thing I've found is that when adding new objects to a scene, phaser 3 is noticeably a lot slower. Dunno why ?

Link to comment
Share on other sites

11 hours ago, themoonrat said:

The only consistent thing I've found is that when adding new objects to a scene, phaser 3 is noticeably a lot slower. Dunno why ?

Could be the automatic depth sorting, implemented by heap sort iirc. Not entirely sure it's faster than insertion sort (at least at smaller counts I would expect insertion to be faster, but there it probably doesn't matter), but in either case, whenever anything is added to scene, it's pushed to the end and the child array is marked to be sorted.

Then again, every other engine has to do something like that at some point too.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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