Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonufrienko/rust-vs-go
Compare performance and resources for CLI build with Rust and Go
https://github.com/sonufrienko/rust-vs-go
Last synced: 23 days ago
JSON representation
Compare performance and resources for CLI build with Rust and Go
- Host: GitHub
- URL: https://github.com/sonufrienko/rust-vs-go
- Owner: sonufrienko
- Created: 2022-06-07T13:59:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-07T20:59:47.000Z (over 2 years ago)
- Last Synced: 2024-06-21T18:53:10.027Z (5 months ago)
- Language: Rust
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Compare performance and resources for CLI build with Rust and Go
Date: `June 7, 2022`
Rust: `1.61.0`
Go: `1.18.3`
## Getting Started
cd cli-rust; cargo build --release; cd ../cli-go; go build; cd ..
## Step 1: Empty CLI
| | Bin size | Mem |
| ------- | -------- | ---- |
| Rust | 0.46M | 344K |
| Go | 1.1M | 856K |
| Node.js | - | 8.7M |## Step 2: Serialize JSON 10M times
| | Bin size | Mem | Time |
| ------- | -------- | ----- | ------ |
| Rust | 531K | 480K | 10.88s |
| Go | 2.2M | 6.5M | 39.78s |
| Node.js | - | 11.3M | 11.92s |## Step 3: Array of 20M structs
| | Bin size | Mem | Time |
| ------- | -------- | -------------- | ------ |
| Rust | 461K | 3.3G -> 19.8M | 13.59s |
| Go | 1.1M | 6.92G | 16.38s |
| Node.js | - | 2.38G -> 19.8M | 2.87s |