Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Bad performance when exploding a lot of TNT #8

Open
andreasdc opened this issue May 31, 2021 · 8 comments
Open

Bad performance when exploding a lot of TNT #8

andreasdc opened this issue May 31, 2021 · 8 comments

Comments

@andreasdc
Copy link

image

@ghost
Copy link

ghost commented May 31, 2021

Ion creates a ArrayList in every Explosion call, that's why is inefficient

@andreasdc
Copy link
Author

I don't think creating new list in every explosion is the worst part of it.

@xEricL
Copy link

xEricL commented Jun 1, 2021

@andreasdc If possible, can you please include the link to the full spark profiler result?

@andreasdc
Copy link
Author

@andreasdc If possible, can you please include the link to the full spark profiler result?

currently that's not possible, but I can share more screenshots or provide another result.

@Samsuik
Copy link
Owner

Samsuik commented Jun 7, 2021

It has to raytrace whether the entity is obscured which is very hot code with explosions. If we have 10000 TNT going off in the same tick and in random locations but within range of each other, it would end up having to raytrace over 37 million times.

@andreasdc
Copy link
Author

andreasdc commented Jun 7, 2021

It has to raytrace whether the entity is obscured which is very hot code with explosions. If we have 10000 TNT going off in the same tick and in random locations but within range of each other, it would end up having to raytrace over 37 million times.

Is there a way to make it better?
Also I saw that when you explode many tnts, after it already exploded you still see falling or flying primed tnts, like entitytracker was not keeping up?

@Samsuik
Copy link
Owner

Samsuik commented Jun 7, 2021

Also I saw that when you explode many tnts, after it already exploded you still see falling or flying primed tnts, like entitytracker was not keeping up?

Removal updates are queued and dispatched every tick. If the server is taking a while to process a tick, the entity can exist for a period of time client side until the update is sent out.

@andreasdc
Copy link
Author

That's a little bit problematic too. :/

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

No branches or pull requests

3 participants