{"id":31655516,"url":"https://github.com/jadnohra/zig-crypto-bench","last_synced_at":"2026-05-18T02:10:10.816Z","repository":{"id":314674525,"uuid":"1056321179","full_name":"jadnohra/zig-crypto-bench","owner":"jadnohra","description":"Crypto benchmarks: Zig vs Rust performance comparison.","archived":false,"fork":false,"pushed_at":"2025-09-17T20:51:30.000Z","size":124,"stargazers_count":2,"open_issues_count":8,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-07T13:28:32.797Z","etag":null,"topics":["benchmark","cryptography","perfromance","rust","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/jadnohra.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-13T20:55:15.000Z","updated_at":"2025-09-17T20:51:33.000Z","dependencies_parsed_at":"2025-09-14T02:33:39.800Z","dependency_job_id":"9a1665a5-776a-4949-b960-c1506becf6e1","html_url":"https://github.com/jadnohra/zig-crypto-bench","commit_stats":null,"previous_names":["jadnohra/zig-crypto-bench"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jadnohra/zig-crypto-bench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadnohra%2Fzig-crypto-bench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadnohra%2Fzig-crypto-bench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadnohra%2Fzig-crypto-bench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadnohra%2Fzig-crypto-bench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jadnohra","download_url":"https://codeload.github.com/jadnohra/zig-crypto-bench/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadnohra%2Fzig-crypto-bench/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33162448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"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":["benchmark","cryptography","perfromance","rust","zig"],"created_at":"2025-10-07T13:15:05.840Z","updated_at":"2026-05-18T02:10:10.782Z","avatar_url":"https://github.com/jadnohra.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zig-crypto-bench\n\n[![CI](https://github.com/jadnohra/zig-crypto-bench/workflows/CI/badge.svg)](https://github.com/jadnohra/zig-crypto-bench/actions)\n\nCrypto benchmarks: Zig vs Rust performance comparison.\n\n## Overview\n\nCryptographic performance benchmarks across Zig stdlib and Rust implementations with hardware acceleration.\n\n**Supported platforms**: Linux and macOS (x86_64, aarch64)\n\n## Benchmarked Algorithms\n\n- **SHA-256**: Secure Hash Algorithm 256-bit\n  - Zig: `std.crypto.hash.sha2.Sha256`\n  - Rust: `sha2` crate with hardware acceleration\n- **SHA-512**: Secure Hash Algorithm 512-bit\n  - Zig: `std.crypto.hash.sha2.Sha512` *\n  - Rust: `sha2` crate with hardware acceleration\n\n  \\* *Zig's SHA-512 currently lacks hardware acceleration ([#22266](https://github.com/ziglang/zig/issues/22266)), resulting in expected performance differences.*\n\n\n## Results\n\nRun benchmarks to generate timestamped results in [**`results/`**](results/) directory:\n\n```bash\nzig build bench -- --save-results\n```\n\n\n## Installation\n\n### Prerequisites\n\n- Zig 0.14.1 or later\n- Rust toolchain (for building the comparison library)\n\n### Build Instructions\n\n```bash\ngit clone https://github.com/yourusername/zig-crypto-bench\ncd zig-crypto-bench\nzig build bench\n```\n\n\n## Usage\n\n```bash\n# Run all benchmarks with default settings (500 iterations, 50 warmup)\nzig build bench\n\n# Save timestamped results to results/ directory for contribution\nzig build bench -- --save-results\n\n# Run with custom iteration counts\nzig build bench -- --iterations 2000 --warmup 200\n\n# Generate JSON output for analysis\nzig build bench -- --json \u003e results.json\n\n# Filter specific tests by size\nzig build bench -- --filter 1MB\n\n# Combined: save results with custom settings\nzig build bench -- --save-results --iterations 1000 --warmup 100\n```\n\n## Features\n\n- Adaptive iteration counts with auto-scaling for large inputs\n- Warmup phase to stabilize CPU performance\n- Auto-batching for accurate timing of fast operations\n- Correctness verification via bitwise output comparison\n- Transparent build configuration and optimization flags\n- Statistical analysis\n- CPU frequency governor detection and throttling warnings\n- Framework versioning with git commit tracking in results\n- Two measurement modes: FFI (both use C ABI for fair comparison, default) and native (Zig direct/Rust FFI)\n\n## Contributing\n\n### Contributing Results\n\n**Hardware Results**: Help expand hardware coverage by contributing benchmark results from your system. Run with --save-results and submit the generated markdown files from the [results/](results/) directory.\n\n**Open Issues**: Check the [issues](https://github.com/jadnohra/zig-crypto-bench/issues) for tasks ranging from small improvements to major features.\n\n**Development Conventions**:\n- Test functions must print their title at the start using `std.debug.print(\"\\n✓ Running: Test Name\\n\", .{});`\n  (This is idiomatic in Zig as the test runner lacks built-in verbose output)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjadnohra%2Fzig-crypto-bench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjadnohra%2Fzig-crypto-bench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjadnohra%2Fzig-crypto-bench/lists"}