Show HN: Whirlwind – Async concurrent hashmap for Rust

  • Posted 1 day ago by willothy
  • 135 points
https://github.com/fortress-build/whirlwind
Hey HN, this is Will and David from Fortress (https://news.ycombinator.com/item?id=41426998).

We use a lot of async Rust internally, and created this library out of a need for an async-aware concurrent hashmap since there weren’t many available in the Rust ecosystem.

Whirlwind is a sharded HashMap with a fully asynchronous API. Just as dashmap is a replacement for std::sync::RwLock<HashMap>, whirlwind aims to be a replacement for tokio::sync::RwLock<HashMap>. It has a similar design and performance characteristics to dashmap, but seems to perform better in read-heavy workloads with tokio's green threading.

Benchmarks are in the readme! We used an asyncified version of dashmap's benchmark suite. The project is in a pretty early stage and I'm sure there are flaws, but I'm pretty happy with the performance.

There is some unsafe involved, but we run Miri in ci to (hopefully) catch undefined behavior well before it's in an actual release.

We'd appreciate any feedback! Thanks in advance :)

12 comments

    Loading..
    Loading..
    Loading..
    Loading..
    Loading..
    Loading..
    Loading..
    Loading..
    Loading..
    Loading..
    Loading..
    Loading..