https://github.com/fortress-build/whirlwind Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By company size + Enterprises + Small and medium teams + Startups By use case + DevSecOps + DevOps + CI/CD + View all use cases By industry + Healthcare + Financial services + Manufacturing + Government + View all industries View all solutions * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} fortress-build / whirlwind Public * Notifications You must be signed in to change notification settings * Fork 4 * Star 230 Ridiculously fast, fully asynchronous, sharded hashmap for Rust. crates.io/crates/whirlwind License Apache-2.0 license 230 stars 4 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 3 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights fortress-build/whirlwind main BranchesTags [ ] Go to file Code Folders and files Last Last Name Name commit commit message date Latest commit History 36 Commits .github/workflows .github/workflows results results src src tests tests .gitignore .gitignore .release-please-manifest.json .release-please-manifest.json CHANGELOG.md CHANGELOG.md Cargo.lock Cargo.lock Cargo.toml Cargo.toml LICENSE LICENSE README.md README.md View all files Repository files navigation * README * Apache-2.0 license Whirlwind Build Status Crates.io Docs.rs License An asynchronous, sharded HashMap for high-performance concurrent data access in Rust. Note This crate is in development, and breaking changes may be made up until a 1.0 release. Table of Contents * Features * Installation * Usage * Examples * Benchmark * Contributing * License Features * Async Ready: Seamless integration with Rust's async/await syntax. * High Performance: Sharding minimizes lock contention in concurrent environments. * Thread-safe: Safe for use across multiple threads without fear of data races. * Familiar API: Intuitive HashMap-like interface for ease of adoption. * Customizable Shards: Configure the number of shards to optimize for your workload. Installation Add whirlwind to your Cargo.toml: [dependencies] whirlwind = "0.1.1" Usage Here's a quick example to get you started: use whirlwind::ShardMap; #[tokio::main] async fn main() { let map = ShardMap::new(); map.insert("apple", 3).await; map.insert("banana", 5).await; if let Some(quantity) = map.get(&"apple").await { println!("We have {} apples!", quantity); } map.remove(&"banana").await; } Examples Concurrent Inserts use whirlwind::ShardMap; use tokio::task::JoinSet; #[tokio::main] async fn main() { let map = ShardMap::new(); let tasks: JoinSet<_> = (0..1000).map(|i| { let map = map.clone(); tokio::spawn(async move { map.insert(i, i * 2).await; }) }).collect(); tasks.join_all().await.ok(); assert_eq!(map.len().await, 1000); } Custom Shard Count use whirlwind::ShardMap; #[tokio::main] async fn main() { let map = ShardMap::with_shards(64); // Initialize with 64 shards // Use the map as needed } Benchmarks Benchmarks were run in a asyncified version of this benchmark. You can find it here. Since the benchmarks use jonhoo/bustle, an asyncified fork of that library (here) is required. Machine: Apple M3 Max (2023 16-inch MacBook Pro, 36GB RAM) OS: macOS 15.0 See the results/ directory. Read Heavy (std hasher) [ReadHeavy] [ReadHeavy] Exchange (std hasher) [Exchange] [Exchange] Rapid Grow (std hasher) [RapidGrow] [RapidGrow] Read Heavy (ahash) [ReadHeavy] [ReadHeavy] Exchange (ahash) [Exchange] [Exchange] Rapid Grow (ahash) [RapidGrow] [RapidGrow] Contributing Contributions are welcome! Please follow these steps: 1. Fork the repository. 2. Create a new branch: git checkout -b feature/your-feature. 3. Commit your changes: git commit -am 'Add your feature'. 4. Push to the branch: git push origin feature/your-feature. 5. Open a pull request. Running Tests Ensure all tests pass before submitting a PR: cargo test Code Style We use rustfmt for code formatting: cargo fmt -- --check License Copyright 2024 Will Hopkins Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --------------------------------------------------------------------- Made with and Rust. About Ridiculously fast, fully asynchronous, sharded hashmap for Rust. crates.io/crates/whirlwind Topics rust async concurrency tokio hashmap async-rust concurrent-hashmap Resources Readme License Apache-2.0 license Activity Custom properties Stars 230 stars Watchers 3 watching Forks 4 forks Report repository Releases 2 v0.1.1 Latest Nov 4, 2024 + 1 release Packages 0 No packages published Languages * Rust 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.