Open dlgs5100 opened 10 months ago
This is likely because by default the binary is built with debug symbols: https://github.com/influxdata/influxdb/blob/acfef87659c9a8c4c49e4628264369569e04cad1/Cargo.toml#L142-L145
Removing the debug=true
or running strip
on the resulting binary will likely make is much smaller
After using strip = "symbols"
and codegen-units = 1
The binary size is about 81M
That helps me a lot, thank you @alamb
Describe the issue I use
RUSTFLAGS="-C linker=x86_64-linux-gnu-gcc" cargo build --release
to build the latest InfluxDB v3 on main branch. I noticed that the generated binary size has reached an astonishing 1.7 GB. Even settingopt-level = "z"
andlto = "thin"
inCargo.toml
, the binary size remains 992.9 MB. It still too large in my situation.Environment OS: x86_64 linux Toolchain: x86_64-linux-gnu-gcc
Here are my questions:
opt-level = "z"
andlto = "thin"
?By the way, I noticed that metrico/iox-community provides release binaries only 31.1 MB. This seems to be a reasonable size. Does anyone know the differences in the build process that lead to such a contrast in binary size?