Commit 1e1c2c1
committed
feat: optimize binary size with Cargo profile settings
- Add [profile.release] section with size optimization flags
- opt-level = 'z' for size optimization
- lto = true for link-time optimization
- strip = 'debuginfo' to remove debug symbols
- panic = 'abort' to remove panic unwinding code
- codegen-units = 1 for better optimization
- overflow-checks = true for safety
Results:
- Binary size reduced from 7.5MB to 4.5MB (40% reduction)
- Docker image size reduced from 141MB to 136MB
- Tracing functionality preserved and working correctly1 parent b907eb6 commit 1e1c2c1
1 file changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
0 commit comments