Skip to content

Use usize instead of u64 for hashes in HashMap #36567

Closed
@bluss

Description

@bluss

Just a note on the current implementation which stores the hash values per bucket as u64. We can't use more than usize's bits of a hash to select a bucket anyway, so we only need to store that part in the table. This would be an improvement on 32-bit platforms to make the hashmap's data structures smaller, hopefully improving cache utilization during insert and lookup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-collectionsArea: `std::collections`T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions