News for hackers. Stuff that matters.
Re:Show HN: Whirlwind – Async concurrent hashmap for Rust by shepardrtc on Tuesday November 05, 2024 @02:14PM (#42054362)
How do you determine the number of shards to use?
Re:Show HN: Whirlwind – Async concurrent hashmap for Rust by willothy on Tuesday November 05, 2024 @02:19PM (#42054391)
I use a multiple of `std::thread::available_paralellism()`. Tbh I borrowed the strategy from dashmap, but I tested others and this seemed to work quite well. Considering making that configurable in the future so that it can be specialized for different use-cases or used in single-threaded but cooperatively scheduled contexts.
Re:Show HN: Whirlwind – Async concurrent hashmap for Rust by cogman10 on Tuesday November 05, 2024 @02:19PM (#42054392)
(std::thread::available_parallelism().map_or(1, usize::from) * 4).next_power_of_two()