#What's the point of entityQuery.ToComponentDataListAsync?

1 messages · Page 1 of 1 (latest)

edgy wolf
#

I'm asking this because it's only one thread assigned with this, it isn't any faster, in fact... it's even slower (due to job overhead). What is the point of this method? Am I using this in the wrong way?

What I'm doing is getting a query of every entity and reading over all of their values.

onyx compass
#

When you do .ToComponentDataListAsync you will not break your frame with extra sync point.
If you call .ToComponentDataArray it will force your main thread stop and wait until all the jobs that potentially can use components listed in your query (maybe even more I'm not an expert actually).
You will not notice any difference if your project contains a few systems, but when there are hundrends of them it will be a mess. Also it will have a bigger impact on client where your framerate could be much higher than 60 ticks.