https://github.com/hrkings/compile-size-comparison
https://github.com/hrkings/compile-size-comparison
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hrkings/compile-size-comparison
- Owner: HRKings
- Created: 2022-07-06T21:24:27.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-06T21:24:36.000Z (almost 3 years ago)
- Last Synced: 2024-12-27T13:23:28.912Z (5 months ago)
- Language: Shell
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Size comparison
This is a very simple repo to test the file sizes of a "Hello World" program written in different languages
## Results
### File sizes in bytes:
```
c_dynamic -> 20544
c_dynamic_strip -> 14408
c_static -> 865560
c_static_strip -> 778248
cpp_dynamic -> 20976
cpp_dynamic_strip -> 14424
cpp_static -> 2439536
cpp_static_strip -> 1958704
go_static -> 1758428
go_static_strip -> 1180440
rust_dynamic -> 22504
rust_dynamic_strip -> 14464
rust_static -> 3845960
rust_static_strip -> 321848
```### File sizes (human readable):
```
c_dynamic -> 21K
c_dynamic_strip -> 15K
c_static -> 846K
c_static_strip -> 761K
cpp_dynamic -> 21K
cpp_dynamic_strip -> 15K
cpp_static -> 2,4M
cpp_static_strip -> 1,9M
go_static -> 1,7M
go_static_strip -> 1,2M
rust_dynamic -> 22K
rust_dynamic_strip -> 15K
rust_static -> 3,7M
rust_static_strip -> 315K
```## Testing it yourself
If you clone this repository the test can be run using the `test.sh` which will compile the several programs (one static, one dynamic and a stripped variation of the two) and will print the results.