pyapp
pyapp copied to clipboard
Reduce compile-time by migrating from `reqwest` to `ureq`
Hello!
I was reading these very interesting blog posts: https://corrode.dev/blog/tips-for-faster-rust-compile-times/ https://blog.kodewerx.org/2020/06/the-rust-compiler-isnt-slow-we-are.htmlreq
And I was wondering if we are able to reduce the compile time of pyapp with easy and stable adjusments.
In the blog post, they talk for example of replacing reqwest
by ureq
if we don't care.
https://docs.rs/ureq/latest/ureq/
Ureq is in pure Rust for safety and ease of understanding. It avoids using unsafe directly. It uses blocking I/O instead of async I/O, because that keeps the API simple and keeps dependencies to a minimum.
=> We don't use async so I tried 👍
And indeed we removed ~90 dependencies to compile, reducing the build time between 3 and 5 seconds in my laptop. There is only two function calling reqwest so the migration was quite easy, and we keep the progress bars.
Curious of your opinion about this, I personally believe that in the CI/CD every seconds matter ! 😆 With, for example, a job building for 6 platforms (3 OS, 2 CPU architecture), saving even 3 ou 4 seconds per compilation is not so useless 🙂
I will link a related pull-request 🙂 Thanks !