seanmonstar / reqwest

An easy and powerful Rust HTTP Client
https://docs.rs/reqwest
Apache License 2.0
10k stars 1.13k forks source link

Consider disabling "ffi-api" feature in "brotli" dependency #1324

Open bartlomieju opened 3 years ago

bartlomieju commented 3 years ago

Prompted by https://matklad.github.io/2021/09/04/fast-rust-builds.html I did some profiling for build in Deno and found out that bulk of time is spent compiling "brotli" crate. We only depend on "brotli" indirectly via "reqwest" dependency:

Screenshot 2021-09-05 at 20 57 43

Above picture was generated using cargo +nightly build -Z timings --release.

As seen "brotli" is actually compiled twice and spends bulk of time in codegen. I'm not entirely sure if "ffi-api" contributes to that in anyway, but it seems like a superfluous feature given that reqwest doesn't use "ffi-api" in any capacity.

seanmonstar commented 3 years ago

Cool catch. I don't know much about it, but if we don't need it, and it makes a difference, sure! Would you like to research it a little more and if so, send a PR disabling it?

bartlomieju commented 3 years ago

Sure, I will raise a PR.