{"id":26722510,"url":"https://github.com/willothy/whirlwind","last_synced_at":"2025-05-14T17:19:17.058Z","repository":{"id":260707242,"uuid":"881843790","full_name":"willothy/whirlwind","owner":"willothy","description":"🌀 Ridiculously fast, fully asynchronous, sharded hashmap for Rust.","archived":false,"fork":false,"pushed_at":"2025-01-17T06:16:12.000Z","size":70,"stargazers_count":499,"open_issues_count":9,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-29T06:47:19.849Z","etag":null,"topics":["async","async-rust","concurrency","concurrent-hashmap","hashmap","rust","tokio"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/whirlwind","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willothy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-01T11:06:57.000Z","updated_at":"2025-04-28T09:22:22.000Z","dependencies_parsed_at":"2025-03-27T20:04:42.918Z","dependency_job_id":"92fb6c1f-98b2-4504-8772-54acffe423ff","html_url":"https://github.com/willothy/whirlwind","commit_stats":null,"previous_names":["fortress-build/whirlwind","willothy/whirlwind"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willothy%2Fwhirlwind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willothy%2Fwhirlwind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willothy%2Fwhirlwind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willothy%2Fwhirlwind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willothy","download_url":"https://codeload.github.com/willothy/whirlwind/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254190388,"owners_count":22029639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","async-rust","concurrency","concurrent-hashmap","hashmap","rust","tokio"],"created_at":"2025-03-27T20:02:42.952Z","updated_at":"2025-05-14T17:19:17.049Z","avatar_url":"https://github.com/willothy.png","language":"Rust","readme":"# 🌀 Whirlwind\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/fortress-build/whirlwind/rust.yml?branch=main)](https://github.com/yourusername/shardmap/actions)\n[![Crates.io](https://img.shields.io/crates/v/whirlwind)](https://crates.io/crates/whirlwind)\n[![Docs.rs](https://docs.rs/whirlwind/badge.svg)](https://docs.rs/whirlwind)\n[![License](https://img.shields.io/crates/l/whirlwind)](https://github.com/fortress-build/whirlwind/blob/main/LICENSE)\n\nAn asynchronous, sharded `HashMap` for high-performance concurrent data access\nin Rust.\n\n\u003e [!NOTE]\n\u003e This crate is in development, and breaking changes may be made up until a 1.0 release.\n\n## 📖 Table of Contents\n\n- [Features](#-features)\n- [Installation](#-installation)\n- [Usage](#-usage)\n- [Examples](#-examples)\n- [Benchmark](#-benchmarks)\n- [Contributing](#-contributing)\n- [License](#license)\n\n## ✨ Features\n\n- **Async Ready**: Seamless integration with Rust's `async`/`await` syntax.\n- **High Performance**: Sharding minimizes lock contention in concurrent environments.\n- **Thread-safe**: Safe for use across multiple threads without fear of data races.\n- **Familiar API**: Intuitive `HashMap`-like interface for ease of adoption.\n- **Customizable Shards**: Configure the number of shards to optimize for your workload.\n\n## 📦 Installation\n\nAdd `whirlwind` to your `Cargo.toml`:\n\n```toml\n[dependencies]\nwhirlwind = \"0.1.1\"\n```\n\n## 🔧 Usage\n\nHere's a quick example to get you started:\n\n```rust\nuse whirlwind::ShardMap;\n\n#[tokio::main]\nasync fn main() {\n    let map = ShardMap::new();\n\n    map.insert(\"apple\", 3).await;\n    map.insert(\"banana\", 5).await;\n\n    if let Some(quantity) = map.get(\u0026\"apple\").await {\n        println!(\"We have {} apples!\", quantity);\n    }\n\n    map.remove(\u0026\"banana\").await;\n}\n```\n\n## 📚 Examples\n\n### Concurrent Inserts\n\n```rust\nuse whirlwind::ShardMap;\nuse tokio::task::JoinSet;\n\n#[tokio::main]\nasync fn main() {\n    let map = ShardMap::new();\n    let tasks: JoinSet\u003c_\u003e = (0..1000).map(|i| {\n        let map = map.clone();\n        tokio::spawn(async move {\n            map.insert(i, i * 2).await;\n        })\n    }).collect();\n\n    tasks.join_all().await.ok();\n\n    assert_eq!(map.len().await, 1000);\n}\n```\n\n### Custom Shard Count\n\n```rust\nuse whirlwind::ShardMap;\n\n#[tokio::main]\nasync fn main() {\n    let map = ShardMap::with_shards(64); // Initialize with 64 shards\n    // Use the map as needed\n}\n```\n\n## 📊 Benchmarks\n\nBenchmarks were run in a asyncified version of [this benchmark](https://github.com/xacrimon/conc-map-bench). You can\nfind it [here](https://github.com/willothy/conc-map-bench). Since the benchmarks use [`jonhoo/bustle`](https://github.com/jonhoo/bustle),\nan asyncified fork of that library ([here](https://github.com/willothy/bustle)) is required.\n\nMachine: Apple M3 Max (2023 16-inch MacBook Pro, 36GB RAM)\n\nOS: macOS 15.0\n\nSee the `results/` directory.\n\n### Read Heavy (std hasher)\n\n| | |\n:-------------------------:|:-------------------------:\n![](results/ReadHeavy.std.throughput.svg) | ![](results/ReadHeavy.std.latency.svg)\n\n### Exchange (std hasher)\n\n| | |\n:-------------------------:|:-------------------------:\n![](results/Exchange.std.throughput.svg) | ![](results/Exchange.std.latency.svg)\n\n### Rapid Grow (std hasher)\n\n| | |\n:-------------------------:|:-------------------------:\n![](results/RapidGrow.std.throughput.svg) | ![](results/RapidGrow.std.latency.svg)\n\n### Read Heavy (ahash)\n\n| | |\n:-------------------------:|:-------------------------:\n![](results/ReadHeavy.ahash.throughput.svg) | ![](results/ReadHeavy.ahash.latency.svg)\n\n### Exchange (ahash)\n\n| | |\n:-------------------------:|:-------------------------:\n![](results/Exchange.ahash.throughput.svg) | ![](results/Exchange.ahash.latency.svg)\n\n### Rapid Grow (ahash)\n\n| | |\n:-------------------------:|:-------------------------:\n![](results/RapidGrow.ahash.throughput.svg) | ![](results/RapidGrow.ahash.latency.svg)\n\n## 🤝 Contributing\n\nContributions are welcome! Please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch: `git checkout -b feature/your-feature`.\n3. Commit your changes: `git commit -am 'Add your feature'`.\n4. Push to the branch: `git push origin feature/your-feature`.\n5. Open a pull request.\n\n### Running Tests\n\nEnsure all tests pass before submitting a PR:\n\n```sh\ncargo test\n```\n\n### Code Style\n\nWe use `rustfmt` for code formatting:\n\n```sh\ncargo fmt -- --check\n```\n\n## License\n\nCopyright 2024 Will Hopkins\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n---\n\nMade with 💖 and Rust.\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillothy%2Fwhirlwind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillothy%2Fwhirlwind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillothy%2Fwhirlwind/lists"}