Leafwing-Studios / leafwing_manifest

Data-driven content generation for Bevy
Apache License 2.0
73 stars 2 forks source link

Use the identity hash inside of `Id::hash` #20

Closed alice-i-cecile closed 7 months ago

alice-i-cecile commented 7 months ago

What problem does this solve?

The values of Id are already hashed: we don't need to double-hash.

What solution would you like?

  1. Write some benchmarks.
  2. Borrow from https://docs.rs/bevy/latest/bevy/utils/type.TypeIdMap.html for implementation strategy.
  3. Double-check that this is faster.
sixfold-origami commented 7 months ago

Unnecessary: the stdlib Hash implementation for u64 just uses Hasher.write_u64 internally: https://doc.rust-lang.org/src/core/hash/mod.rs.html#800-836