(no title)
drabbiticus | 8 months ago
Second off, I didn't realize how deep the dep tree would be for this type of program -- 141 total! So much of it is the url crate, itself a dep of the git crate, but there's a bunch of others too. I'm just getting into learning Rust -- is this typical of Rust projects or perhaps typical of TUI projects in general?
(EDIT to strikeout) ~~The binary is also 53M as a result whereas /usr/sbin/tree is 80K on my machine -- not really a problem on today's storage, but very roughly 500-1000x different in size isn't nothing.~~
Maybe it's linking-related? I don't know how to check really.
(EDIT: many have pointed out that you can run `cargo build --release` with other options to get a much smaller binary. Thanks for teaching me!)
JoshTriplett|8 months ago
That's a debug binary, and the vast majority of that is debug symbols. A release build of this project is 4.3M, an order of magnitude smaller.
Also, compiling out the default features of the git2 crate eliminates several dependencies and reduces it further to 3.6M.
https://github.com/bgreenwell/lstr/pull/5
https://github.com/rust-lang/git2-rs/pull/1168
Stripping the binary further improves it to 2.9M, and some further optimizations get it to 2.2M without any compromise to performance. (You can get it smaller by optimizing for size, but I wouldn't recommend that unless you really do value size more than performance.)
esafak|8 months ago
CGamesPlay|8 months ago
pveierland|8 months ago
cyann|8 months ago
I'll try with `panic = "abort"` for our next release, thanks for the reminder.
fabrice_d|8 months ago
getcrunk|8 months ago
If you just think about how roughly (napkin math) 2MB can be 100k loc, that’s nuts
arlort|8 months ago
vlovich123|8 months ago
ethan_smith|8 months ago
aystatic|8 months ago