-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Consider making mutating Assets<T> more Scheduler friendly #8
Comments
Wouldn’t it encourage making large systems? To me making small systems is good practice because it makes parallelism better and as a result should reduce the cost of mutable asset modification, maybe? |
Whats your definition of "system size" in this case? Number of I agree that keeping the |
System size to me is the amount of work it does on a run. In a sense this is somewhat linked to the amount of dependencies but not really. But come to think of it, if it’s an optional way to optimize some really specific cases that can’t be solved otherwise, it seems okay to me. |
updates for bevy_mod_picking 0.4
We encountered this in #6341, where there were a large number of spurious system order ambiguities caused by |
Closing this because I'm not convinced it is worth solving. The odds of multiple systems writing assets at the same time (and that being a bottleneck) is slim, whereas something like RwLock-ing everything would be a constant overhead. If this ever shows up in benchmarks we can reconsider. |
Remove todo: We can use `metadata`
bump naga version
Modifying an asset currently requires grabbing a mutable reference to
Assets<T>
. This makes sense conceptually, but Legion's Scheduler (correctly) synchronizes when a mutable reference is grabbed. This means multiple systems requiring mut access to the sameAssets<T>
storage cant run in parallel.It is worth adding some interior mutability /
RwLock
s toAssets<T>
to see if this improves performance for common use cases.The text was updated successfully, but these errors were encountered: