-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate build bloat #536
Comments
@dherman I briefly looked into this after building volta for myself and getting kind of mad at how long it took to compile everything. In particular,
The latter is the hard part because the hyper-011 feature in reqwest is removed in 0.10.0, so everything in #267 needs to be ported to new reqwests and it isn't AFAICT as trivial as a revert. I doubt doing this will help binary size but it'll at least noticeably reduce the build time. It would also be nice to finally update these libraries. |
There's also https://github.com/algesten/ureq if volta's willing to trade async http(s) for a significant boost in simplicity and correctness, I'd wager it would be worth it. Or, https://github.com/sbstp/attohttpc. See https://users.rust-lang.org/t/lightweight-alternative-for-reqwest/33601/18. |
Thanks for all that investigation @joshuarli! We actually don't use async http at all, everything is synchronous AFAIK. We've looked at As for upgrading |
If everything's indeed synchronous then the largest binary size (and compilation time) win would definitely be to move to pure non-async - of the two I mentioned above, it looks like attohttpc can do TLS via openssl: https://github.com/sbstp/attohttpc/blob/master/Cargo.toml#L42 |
Not very good at rust but I can probably take a stab at looking more into attohttpc. I did a shitty attempt in trying to upgrade reqwest but it got a bit convoluted, haha. |
We'd definitely take a PR swapping to a smaller HTTP client! I took a look several months back at switching to |
Would you happen to stil have that branch lying around? Could be useful reference for me. If not, that's okay. |
I don't, sorry 🙁 I'm not sure if I finished the work or got part-way in and decided it wasn't worth the extra effort, but it seems like I didn't ever push it up. |
A friend told me about this recent article on Rust build sizes, and specifically the article links to a useful tool: cargo-bloat.
We should use that tool to see if there are places we can reduce the binary size of Volta builds (and possibly the build times as a consequence).
One particular hint I got was that reqwest is an especially large library, and there are competitors like isahc that are considerably smaller. We'd have to investigate to see if it looks like a good tradeoff, though (in terms of feature set, quality, level of maintenance).
And generally let's keep our wits about us—smaller binary size is good, but not if it comes at too high of a cost. It's not the only goal.
The text was updated successfully, but these errors were encountered: