- Set `default-features=false` where applicable
- Use specific num libraries instead of the top-level crate, as some
parts like complex numbers are not used.
- Replace reqwest with curl, which links the system libcurl and libssl
when possible.
- Add `opt-level="z"` and enable LTO for release builds.
All these changes combined, the CLI binary goes from 10.7 megabytes (or
8.7 manually stripped) to 5.4 megabytes.
The wasm binary is unaffected, still around 2.3 megabytes.
Much of the code organization and architecture of Rink has been the same since I hacked this project together in 2016. In this PR, I spent about a day moving files around and refactoring code.
I'm hoping that cleaning up the codebase like this will help make it easier to change going forwards. There's a lot of duplicated code, few abstractions are used.
In order to make this not break everything I did it in tiny steps, verifying the test suite each time. The original branch has >30 commits in it as a result.