akiomik/buddhabrot-benchmarks
Buddhabrot fractal implementations in multiple languages with benchmarking
Buddhabrot fractal implementations in Odin, Roc, Rust, and Zig with benchmarking.
dev-2025-11:e5153a937 with -o:speedd73ea109cc2 on Tue Sep 9 10:23:53 UTC 2025 with --optimize1.91.1 (ed61e7d7e 2025-11-07) with --profile release0.15.2 with --release=fast| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
Odin |
684.3 ± 13.9 | 674.1 | 700.2 | 1.00 |
Zig |
724.0 ± 5.3 | 718.7 | 729.4 | 1.06 ± 0.02 |
Roc |
857.5 ± 11.8 | 848.0 | 870.7 | 1.25 ± 0.03 |
Rust |
857.6 ± 13.6 | 842.4 | 868.6 | 1.25 ± 0.03 |
NOTE All implementations use standard library random number generators for fair comparison. The performance difference observed on macOS is likely due to Rust's
std::randomimplementation using cryptographically secure random number generation via system calls, while other languages appear to use faster pseudo-random generators.
| Language | Executable Size | Relative to Smallest |
|---|---|---|
Odin |
168K | 1.00x |
Zig |
229K | 1.36x |
Rust |
399K | 2.38x |
Roc |
4.6M | 28.0x |
just (Task runner)hyperfine (Benchmarking)mise (Version manager - optional, for managing language versions)# Build all implementations
just build-all
# Run comprehensive benchmark
just bench
# Build and test a specific implementation
just dev odin # or rust, zig, roc
# See all available commands
just --list
just bench # Benchmark with statistics
just file-sizes # List binary sizes
# All languages
just build-all # Build all implementations
just clean # Clean all build artifacts
# Individual languages
just build-odin # Build Odin implementation
just run-odin # Run Odin implementation
just dev odin # Build and run Odin
just profile-odin # Profile Odin implementation
just build-roc # Build Roc implementation
just run-roc # Run Roc implementation
just dev roc # Build and run Roc
just profile-roc # Profile Roc implementation
just build-rust # Build Rust implementation
just run-rust # Run Rust implementation
just dev rust # Build and run Rust
just profile-rust # Profile Rust implementation
just build-zig # Build Zig implementation
just run-zig # Run Zig implementation
just dev zig # Build and run Zig
just profile-zig # Profile Zig implementation