My CPU is a Amd Ryzen 9 7950x, so results may vary a lot on other CPUs.
My Rust binary is still pretty small compared to normal Rust binaries, check the Cargo.toml file for more info.
The C and Rust binaries are dynamically linked, and the Zig binary is statically linked.
Build
clang -Ofast -lm main.c -o sieve
Result
time ./sieve 100000000
# 0.33s, 96MB MAX RAM, 16k binary size
Build
zig build -Doptimize=ReleaseFast
Result
time ./zig-out/bin/zig 100000000
# 0.44s, 143MB MAX RAM, 25k binary size
Build
cargo build --release
Result
time ./target/release/rust 100000000
# 0.47s, 96MB MAX RAM, 293k binary size