diff options
| author | bors <bors@rust-lang.org> | 2021-12-18 21:23:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-12-18 21:23:37 +0000 |
| commit | daf2204aa4954a9426cee93eb1baa2b26eb69070 (patch) | |
| tree | c216ecab68b04a59d4aec7fb65c6a63af718fe0d /compiler/rustc_codegen_llvm/src/attributes.rs | |
| parent | 91a0600a5c22b9d159e3c57526af83e71d1120f8 (diff) | |
| parent | 1f284b07edaae02324947221b2e0660e07fc5618 (diff) | |
| download | rust-daf2204aa4954a9426cee93eb1baa2b26eb69070.tar.gz rust-daf2204aa4954a9426cee93eb1baa2b26eb69070.zip | |
Auto merge of #91837 - Kobzol:stable-hash-map-avoid-sort, r=the8472
Avoid sorting in hash map stable hashing Suggested by `@the8472` [here](https://github.com/rust-lang/rust/pull/89404#issuecomment-991813333). I hope that I understood it right, I replaced the sort with modular multiplication, which should be commutative. Can I ask for a perf. run? However, locally it didn't help at all. Creating the `StableHasher` all over again is probably slowing it down quite a lot. And using `FxHasher` is not straightforward, because the keys and values only implement `HashStable` (and probably they shouldn't be just hashed via `Hash` anyway for it to actually be stable). Maybe the `StableHash` interface could be changed somehow to better suppor these scenarios where the hasher is short-lived. Or the `StableHasher` implementation could have variants with e.g. a shorter buffer for these scenarios.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/attributes.rs')
0 files changed, 0 insertions, 0 deletions
