Reduce size of compiled binaries?
For some time, I've had a statically compiled linux version of rsvg-convert
(version 2.40.18) that runs as part of a microservice. Recently I upgraded to version 2.48.3 and noticed that the compiled binaries are significantly larger (around 4x). I've also checked the size of librsvg 2.48.3 installed using homebrew on my mac, and I see the same thing there. I compile the executable like this:
./configure --prefix=$BUILD_PATH --disable-shared --enable-static
make && make install
I noticed that Cargo.toml in the project root contains the following lines
[profile.release]
debug = true
so I tried setting debug = false
, which resulted in about 50% smaller binary size. Is there a good reason that I don't understand for setting debug = true
? Or should debug = false
perhaps be the default unless otherwise specified? Also, if there additional ways of reducing the binary size, I would love to know!
Thanks for maintaining and improving this amazing library!