https://github.com/lucascompython/zigXrustXc
Performance of Zig vs Rust vs C
https://github.com/lucascompython/zigXrustXc
Last synced: 3 months ago
JSON representation
Performance of Zig vs Rust vs C
- Host: GitHub
- URL: https://github.com/lucascompython/zigXrustXc
- Owner: lucascompython
- License: gpl-3.0
- Created: 2023-04-17T20:02:41.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-05-08T12:42:01.000Z (6 months ago)
- Last Synced: 2025-05-08T13:42:38.062Z (6 months ago)
- Language: Zig
- Homepage:
- Size: 25.4 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zig - lucascompython/zigXrustXc
- awesome-rust-list - lucascompython/zigXrustXc
README
# Performance of Zig vs Rust vs C
## Things to know
My Rust binary is still pretty small compared to normal Rust binaries, check the [Cargo.toml](./rust/Cargo.toml#L11) file for more info.
But it could be much smaller, see this [repo](https://github.com/johnthagen/min-sized-rust).
All binaries are statically linked, striped and optimized for **speed**.
- C -> 716Kb
- Rust -> 1.2MB
- Zig -> 16Kb!!!
C and Rust appear to link to `libc` while Zig doesn't, maybe thats why it's so much smaller.
Results on AMD 9950X:

## How to run
```bash
./run.sh
```