Skip to content

Support for gxhash #14

@marvin-hansen

Description

@marvin-hansen

The gxhash crate hashes quite a bit faster than ahash, see benchmarks for a comparison.

However, because the with_hasher constructor of whirlwind relies on RandomState as trait bound instead of the usual Hash or BuildHasher, you simply cannot construct a ShardMap with gxhash. For example, the following code:

    pub fn new(num_cpus: usize, capacity: usize) -> Self {
        let hasher = gxhash::GxBuildHasher::default();

        Self {
            streams_by_id: Arc::new(ShardMap::with_shards_and_capacity_and_hasher(
                num_cpus, capacity, hasher,
            )),
        }
    }

Does not compile because hasher is not of type std::hash::random::RandomState.

I don't know how to solve this, so please advise if its even possible to use ShardMap with gxhash.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions