{"id":34733576,"url":"https://github.com/tracy-codes/basic-rust-concurrency-benchmarks","last_synced_at":"2026-05-25T02:37:53.806Z","repository":{"id":242275272,"uuid":"809125642","full_name":"tracy-codes/basic-rust-concurrency-benchmarks","owner":"tracy-codes","description":"A set of benchmarks to compare the performance of different concurrency primitives in Rust","archived":false,"fork":false,"pushed_at":"2024-06-01T19:00:12.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-01T22:04:50.998Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tracy-codes.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-06-01T19:00:04.000Z","updated_at":"2024-06-01T22:05:16.722Z","dependencies_parsed_at":"2024-06-01T22:05:15.524Z","dependency_job_id":"d33e4603-6ab9-48bc-a36d-0ec09fc290f1","html_url":"https://github.com/tracy-codes/basic-rust-concurrency-benchmarks","commit_stats":null,"previous_names":["tracy-codes/basic-rust-concurrency-benchmarks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tracy-codes/basic-rust-concurrency-benchmarks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tracy-codes%2Fbasic-rust-concurrency-benchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tracy-codes%2Fbasic-rust-concurrency-benchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tracy-codes%2Fbasic-rust-concurrency-benchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tracy-codes%2Fbasic-rust-concurrency-benchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tracy-codes","download_url":"https://codeload.github.com/tracy-codes/basic-rust-concurrency-benchmarks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tracy-codes%2Fbasic-rust-concurrency-benchmarks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28017953,"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","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-12-25T03:19:13.417Z","updated_at":"2025-12-25T03:19:13.599Z","avatar_url":"https://github.com/tracy-codes.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Basic Rust Concurrency Benchmarking\n\nThis repository contains a set of benchmarks to compare the performance of different concurrency primitives in Rust, specifically focusing on `Arc\u003cMutex\u003e`, `Arc\u003cRwLock\u003e`, and `std::sync::mpsc` channels. The benchmarks are designed to measure the performance under read-heavy, write-heavy, and mixed workloads, with an added delay for every even iteration to simulate real-world stalls.\n\n## Prerequisites\n\nTo run these benchmarks, you need to have Rust and Cargo installed on your system. If you don't have them installed, you can download and install them from [rust-lang.org](https://www.rust-lang.org/).\n\nAdditionally, the benchmarks use the following crates:\n\n-   `criterion` for benchmarking\n\nEnsure you add these dependencies to your `Cargo.toml`:\n\n```toml\n[dependencies]\ncriterion = \"0.4\"\n```\n\n## Benchmark Descriptions\n\n### even_iteration_delay\n\nThis function introduces a delay of 25ms for every even iteration. It simulates potential stalls in the execution of threads, adding a delay to every even-numbered iteration.\n\n### Arc\u003cMutex\u003e Benchmarks\n\n-   arc_mutex_read_heavy: Measures the performance of multiple threads concurrently reading from an Arc-wrapped Mutex-protected integer.\n-   arc_mutex_write_heavy: Measures the performance of multiple threads concurrently writing to an Arc-wrapped Mutex-protected integer.\n-   arc_mutex_mixed: Measures the performance of multiple threads performing both reads and writes to an Arc-wrapped Mutex-protected integer.\n\n### Arc\u003cRwLock\u003e Benchmarks\n\n-   arc_rwlock_read_heavy: Measures the performance of multiple threads concurrently reading from an Arc-wrapped RwLock-protected integer.\n-   arc_rwlock_write_heavy: Measures the performance of multiple threads concurrently writing to an Arc-wrapped RwLock-protected integer.\n-   arc_rwlock_mixed: Measures the performance of multiple threads performing both reads and writes to an Arc-wrapped RwLock-protected integer.\n\n### mpsc Channel Benchmarks\n\n-   mpsc_read_heavy: Measures the performance of multiple threads sending and receiving messages through mpsc channels.\n-   mpsc_write_heavy: Measures the performance of multiple threads sending and receiving messages through mpsc channels.\n-   mpsc_mixed: Measures the performance of multiple threads performing both sending and receiving operations through mpsc channels.\n\n### Running the Benchmarks\n\nTo run the benchmarks, use the following command:\n\n```sh\ncargo bench\n```\n\nThis command will execute all the benchmarks and provide you with detailed performance metrics for each test case.\n\n## Contributing\n\nContributions are welcome! If you have any suggestions, bug reports, or improvements, feel free to open an issue or create a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftracy-codes%2Fbasic-rust-concurrency-benchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftracy-codes%2Fbasic-rust-concurrency-benchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftracy-codes%2Fbasic-rust-concurrency-benchmarks/lists"}