4 ms·
tig rules. gitui does not support vim keybinding for me, or I did not find out how. rust's size always surprise me: tig -- 600KB, gitui: 11MB similar size p
by synergy20 4y ago
tig rules.
gitui does not support vim keybinding for me, or I did not find out how.
rust's size always surprise me:
tig -- 600KB, gitui: 11MB
similar size pattern for other utilties, in general, rust executable is about 200x larger than its c/c++ peers, and, they all linked to similar c/c++ libraries, looks like rust stdlib is pretty big in size to me.
- zmmmmm 4y agolooks like there's a key binding file to enable vim bindings. Having said that, I'm also a tig user and at least at first glance, I prefer its simplicity. Gitui presents a huge amount of info on the default screen and spends quite a lot of real estate drawing borders around everything. Tig just takes me straight to the commit history, full screen and then I have single key actions to get to other views. The only thing I don't like with Tig is how little it binds to keys with the expectation that you set up your own mappings to git commands. I would prefer it baked more of them in so they would be standard and documented ... but that is a minor complaint.
- woleium 4y ago+1 for opinionated-tig.
- efficax 4y agorust binaries are statically linked, that's the big difference. If you included all the libc code statically in most c programs they'd probably also be pretty big
- elcritch 4y agoGo programs are also statically linked and Go based CLI tools generally only come in at 3-4 MB IIRC. I've used static linking in binaries in Nim and C programs too with similar (or smaller) sizes. Rust binaries are just impressively large. I'd guess part of it must be how Rust monomorphizes generics: https://rustc-dev-guide.rust-lang.org/backend/monomorph.html https://rustc-dev-guide.rust-lang.org/backend/monomorph.html
- stjohnswarts 4y agoif you strip them you tend to lose a lot of the fat.
- synergy20 4y agowhen i have an embedded board with say 64mb storage,a few rust executable will fill them up fast. problem is that rust does not give me option to do dynamic link to its stdlib.
- MarkSweep 4y agoNot that this is based on some Googleing and experimentation; I could not find official docs. It actually is possible to dynamically link to the standard library. Add this to your project's .cargo/config.toml file: [build] rustflags = ["-C", "prefer-dynamic"] And add a reference to this crate, which copies the stdlib's shared library to your output directory: https://github.com/WilliamVenner/prefer-dynamic https://github.com/WilliamVenner/prefer-dynamic After you do `cargo build --release`, you will notice you hello world EXE is much smaller than a typical rust binary. Like 10~20KB small. On Windows it runs just fine. On Linux, I has to change the exe's RPATH to look for the standard library in the current directory: patchelf --set-rpath '$ORIGIN' ./exe_name Anyways, it is possible. The rustc compiler itself is shipped in this way.
- synergy20 4y agoas far as i know,this is not officially supported.rust links to its stdlib statically by design. when you have to share this stdlib with a few dynamically linked rust crates it's hard to do in practice. tried all size reduction tricks,still the size is much large,like 15x large than c,c++. even the stdlib is a 3x larger than to libstdc++
- thayne 4y agoby default rust doesn't statically link to libc.
- accountofme 4y agoIIRC rust statically links crates used by the application, so it might not just be the stdlib that is causing this.
- thayne 4y agoI bet that size could be brought down with link time optimization, at the cost of longer build times, and potentially slower performance.
- comonoid 4y agoThe gitui has lto enabled.
- comonoid 4y agogitui has much bigger feature set than tig. Rust binaries might be larger because Rust makes creating complex software possible.