-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Remove futures-util dependency #507
Comments
This might be a good replacement https://crates.io/crates/atomic-waker, although very few crates seem to be using it. A better option might be to disable as many features as possible in imports for |
Oh hey, that's literally
Also, it's owned by smol-rs, so maintained by reputable folks. @carllerche @seanmonstar wdyt? Would a PR replacing futures-util by atomic-waker + a copy-pasted |
Is this still a problem even if the next version of futures-util is released? (rust-lang/futures-rs#2273) (Also, note that relying on atomic-waker crate will eventually increase compile time, even if the compile time of h2 alone is shortened.) |
I think we can close this as futures-util 0.3.9 has been released. (All of the main users of this crate seem to depend on futures-util, so adding a dependency like atomic-waker will only increase their compile time.) |
I don't think so. Yes, you reduced the dependencies of futures-util which is pretty nice, but futures-util itself takes almost 4s to compile, before and after, in your own benchmark. Also, h2 still depends on pin-project (through tracing-futures) although on an old version, so it probably benefits some by only having a dependency to one version of it now. You are right about many reverse dependencies of h2 (including hyper, hyper-rustls, reqwest) also depending on futures-util. I will look into whether they use equally small portions of it and try to follow up on their respective issue trackers if that is the case. I'll close this issue if it turns out to not be feasible to remove it from those projects. Feel free to ping me on any relates issues on rust-lang/futures-rs 🙂 |
I looked into it, since I also use |
h2 currently depends on futures-util, which is rather heavy (containing heaps of combinators, plus pulling in most of the other futures-* crates) for only two things:
poll_fn
andAtomicWaker
.poll_fn
could trivially be copy-pasted (and is also coming to std so eventually that could be used), but the same thing is not true forAtomicWaker
. I am not really familiar with the details of wakers, so don't really know how feasible it is to replace that / whether there's maybe an equivalent in tokio / tokio-utils.I hope there is some new info in this issue. If somebody knows about a good replacement for futures-util's
AtomicWaker
, I'd be happy to create a PR removing the futures-util dependency.The text was updated successfully, but these errors were encountered: