pixix4 / ev3dev-lang-rust

Rust language bindings for http://ev3dev.org
MIT License
74 stars 14 forks source link

way to reduce executable size #15

Closed recursivetree closed 3 years ago

recursivetree commented 3 years ago

When I compile a hello world example, the file size for the executable is about 3MB, compared to a few KB in C. This is a lot for only printing hello world, but the main problem is, that transferring it over with bluetooth takes about 30s. I assume that is because large portions of the standard library are included, but not required.

pixix4 commented 3 years ago

I did some testing and found 2 easy ways to reduce the binary size for such an example by around 90% (to around 290 KB). You can try this with the new template repository or by manually applying the optimization as described in the readme.

recursivetree commented 3 years ago

thanks a lot, that helps!