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

Start using hashbrown #6925

Merged
merged 7 commits into from
Jan 16, 2025
Merged

Start using hashbrown #6925

merged 7 commits into from
Jan 16, 2025

Conversation

brody4hire
Copy link
Contributor

@brody4hire brody4hire commented Jan 16, 2025

Connections

Description

see title

Use hashbrown in wgpu-core, wgpu-hal & wgpu-info to simplify no-std support. (This may help improve performance as well.)

Holding off on updating the following crates to use hashbrown:

  • naga - I encountered some build issues with spirv::Capability. I think using hashbrown in naga would be good for no-std build, without the spirv-related feature.
  • main wgpu crate - I encountered some issues testing with webgpu backend & did not feel like introducing a possibly breaking change to the public API. I may revisit this (someday).

Testing

  • cargo build --all-features -p wgpu-core

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@bushrat011899
Copy link
Contributor

Definitely needed. Bevy relied on hashbrown prior to my no_std work anyway, so the transition wasn't too bad. Without switching to hashbrown, the alternative would be refactoring code to not use sets or maps at all, which is likely far more pain than the extra dependency would introduce.

@brody4hire brody4hire mentioned this pull request Jan 16, 2025
12 tasks
@brody4hire brody4hire changed the title start using hashbrown (in wgpu-core) Use hashbrown in wgpu-core & wgpu-hal Jan 16, 2025
@brody4hire brody4hire marked this pull request as ready for review January 16, 2025 05:46
@brody4hire brody4hire requested a review from a team as a code owner January 16, 2025 05:46
Copy link
Contributor

@bushrat011899 bushrat011899 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@brody4hire brody4hire marked this pull request as draft January 16, 2025 08:01
@brody4hire brody4hire changed the title Use hashbrown in wgpu-core & wgpu-hal Use hashbrown in multiple crates Jan 16, 2025
@brody4hire brody4hire changed the title Use hashbrown in multiple crates Start using hashbrown Jan 16, 2025
@brody4hire brody4hire marked this pull request as ready for review January 16, 2025 09:39
@brody4hire
Copy link
Contributor Author

I think this should be ready now, thanks everyone for the quick reviews.

@nical nical merged commit 623f143 into gfx-rs:trunk Jan 16, 2025
30 checks passed
@brody4hire brody4hire deleted the start-using-hashbrown branch January 16, 2025 17:50
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

Successfully merging this pull request may close these issues.

3 participants