https://pantsbuild.org/ logo
#development
Title
# development
h

hundreds-breakfast-49010

12/31/2019, 6:57 PM
hm, I see that we apparently explicitly turn on debug symbols in release in Cargo.toml, which implies this is a deliberate decision
@witty-crayon-22786 it looks like you made this commit adding the debug=true line in Cargo.toml, do you have any thoughts on this?
if we just turn off that line, the output .so file goes to 25MB. but running
strip
on that brings down the file size to 12MB again
I'm not 100% sure what
strip
is doing that debug=false in Cargo.toml isn't doing
also, for what it's worth, increasing the codegen-units from 1 to 4 only increases the size of the resulting binary by 2 MB
which is pretty small
that said, it didn't feel subjectively faster when I was compiling it
a

adamant-mouse-92628

01/01/2020, 7:04 PM
Strip can remove more than just debug symbols.
for example it can remove the symbols table or the reloction information (or arbitrary symbols with specific flags)
a

average-vr-56795

01/06/2020, 11:44 AM
codegen-units is about optimisations, rather than file size, IIRC
h

hundreds-breakfast-49010

01/06/2020, 7:15 PM
@average-vr-56795 I saw some bit of rust documentation that suggested that using a single codegen-unit allowed for some optimizations that aren't possible when you use more than one. I guess some of those must be space optimizations since the binary size does increase if you turn on multiple units
it's just not very significant