Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: [v8 regression] moving a crowded Container drastically cuts performance #10353

Closed
joergplewe opened this issue Mar 21, 2024 · 8 comments
Closed

Comments

@joergplewe
Copy link

Current Behavior

I use to have big containers (>100000 children) which need to be moved around (like panning a map or so).
As soon as the container is moved (myContainer.position.set(x,y);) the framerate drops significantly.
I did not observe this effect in v7.

I also noticed that this effect happens with both WebGL and WebGPU, but with WebGL it is less rude, hence still significant compared to v7.

Expected Behavior

In my (naive) understanding, moving a Container should only touch a single matrix, so framerate must not be affected.
As it was in v7.

Steps to Reproduce

Use https://www.pixiplayground.com/#/edit/-YSyps117HwGc2RU_AG0p

Either play with constant CUT_PERFORMANCE or set it to false and drag the mouse pointer around. Observe drop in framerate.

Environment

Possible Solution

No response

Additional Information

No response

@GoodBoyDigital
Copy link
Member

hey @joergplewe do you have a v7 example of this being slower? is this being compared to a v7 ParticalContainer or regular Container?

@GoodBoyDigital
Copy link
Member

GoodBoyDigital commented Mar 21, 2024

a bit more context

  • Regular container should be faster on v8 than v7 (or this is a regression)
  • ParticleContainer does all transforms on the GPU so will be faster.

@joergplewe
Copy link
Author

Hi!
I think I checked both v7 ParticleContainer and regular Container.
I will provide a playground ASAP to be sure.

@joergplewe
Copy link
Author

As always no simple answer.
https://www.pixiplayground.com/#/edit/GQGWEeMK8aMzR2kpMlV5_

Ok, ParticleContainer in fact is not affected by moving it. v7 regular Container is.
And v8 Container is definitely way more powerful then v7, which makes them hard to compare and benchmark.

I tried to measure them both with 200000 children using the regular Container:

  • v7 drops from 22 FPS to 17
  • v8 drops from >>60 FPS to 29 (v8 falls below 60 FPS unmoved only at ~500000 children)

@GoodBoyDigital
Copy link
Member

cool! ok, that makes sense!

we will make a particle container soon :)

for v8 you also have the renderGroup option:

https://www.pixiplayground.com/#/edit/i5fhM3waCCkMSaOnVD2va

this will be super fast as long as things inside the container remain static!

@joergplewe
Copy link
Author

Ah thanks for the hint. I will investigate.
I still feel that the relatively huge performance drop in v8 is suspicious, isn't it?

@photonstorm
Copy link
Collaborator

Ah thanks for the hint. I will investigate. I still feel that the relatively huge performance drop in v8 is suspicious, isn't it?

It's 60fps when nothing is happening - because the renderer in v8 knows nothing is moving, so isn't actually doing anything at all. Just skipping the render loop. So the moment you move everything, it has to start rendering them all again, hence the fps drop. I'd say this is entirely expected (given the volume of sprites here)

@joergplewe
Copy link
Author

Ok, thx, I think I got it.
From the numbers above I'd conclude that the v8 renderer is 29/17 times faster than v7 :)

Closing the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants