Skip to content

Conversation

@bushrat011899
Copy link
Contributor

Objective

Solution

  • Removed parking_lot from bevy_asset and switched to bevy_platform::sync internally.
  • Removed parking_lot from bevy_macro_utils and switched to std::sync internally. Also added a simple alternative to mapped RwLock guards while the feature is nightly-only.

Testing

  • CI

Notes

It is possible there is a performance change here, but I believe it will be negligible due to performance improvements in std since Bevy adopted parking_lot in #210. If there is a performance difference noticed, I believe the more appropriate course of action would be to move parking_lot into bevy_platform as a feature, so that all parts of Bevy could benefit, not just bevy_asset.

@bushrat011899 bushrat011899 added A-Assets Load files from disk to use for things like images, models, and sounds C-Dependencies A change to the crates that Bevy depends on D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward O-Embedded Weird hardware and no_std platforms labels Apr 30, 2025
@james7132
Copy link
Member

Adopting this under #20630. Added @bushrat011899 as a co-author to that PR.

@james7132 james7132 closed this Aug 19, 2025
github-merge-queue bot pushed a commit that referenced this pull request Sep 30, 2025
# Objective
Spend less time compiling what is already in the standard library.
Remove `parking_lot` from first party crate dependencies. Contribute to
#18978. Supercedes #18996.

## Solution
Use `bevy_platform::sync` types wherever possible.
`BevyManifest::shared` directly returned a mapped guard, but that could
be circumvented by just using a scope-like API instead.

The crate is still in the dependency tree, transitively, through `wgpu`,
but is now no longer required for any non-rendering crates.

## Testing
Ran tests locally.

Co-Authored-By: Zac Harrold <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds C-Dependencies A change to the crates that Bevy depends on D-Straightforward Simple bug fixes and API improvements, docs, test and examples O-Embedded Weird hardware and no_std platforms S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants