Skip to content

Unify Channel Dependency #3309

Open
Open

Description

@ibraheemdev

Hyper currently depends on both futures_channel and tokio::sync, using both channel types in different places. To cut down on dependencies one of these should be removed.

Activity

  1. added
    C-feature
    on Sep 9, 2023
  2. seanmonstar commented on Sep 9, 2023

    @seanmonstar
    Member

    hyper currently uses different channels because the workloads of each benefit from the different channels. When I tried to settle on just one, the benchmarks got worse.

  3. ibraheemdev commented on Sep 10, 2023

    @ibraheemdev
    Author

    Oh interesting, I didn't see anything documented so I just assumed it was oversight.

    I assume there's little difference between the performance of the oneshot channels. Digging deeper, the main use of futures-channel is for a 0 capacity channel, which tokio does not support. I assume you tried to switch everything to tokio and saw performance degradation, which makes more sense because tokio's channels should generally perform better.

  4. ibraheemdev commented on Sep 10, 2023

    @ibraheemdev
    Author

    futures_channel's mpsc::channel(0) is equivalent to a channel with the capacity of the number of senders, so tokio can actually be used instead there as well. Would you be okay with everything switching to tokio if there are equivalent benchmark results?

  5. seanmonstar commented on Sep 10, 2023

    @seanmonstar
    Member

    Yes certainly!

  6. ibraheemdev commented on Sep 10, 2023

    @ibraheemdev
    Author

    Hm, it seems doing things would require using tokio_util::PollSender, which would add another dependency anyways.

  7. added
    C-performance
    and removed
    C-feature
    on Nov 21, 2023
  8. GlenDC commented on Jan 8, 2024

    @GlenDC
    Contributor

    Does this need prior work or can it just be implemented and compare the existing benchmarks before and after?

  9. seanmonstar commented on Jan 8, 2024

    @seanmonstar
    Member

    I don't know of any other prior work.

  10. redactedontop commented on Mar 25, 2025

    @redactedontop

    I believe it'd be benefitial to use PollSender as if @ibraheemdev is correct, Tokio's channels should be faster.

  11. seanmonstar commented on Jun 12, 2026

    @seanmonstar
    Member

    Status: I've submitted a PR in Tokio that should improve the performance reasons that we currently use futures_channel: tokio-rs/tokio#8210

  12. added
    B-upstream
    on Aug 17, 2026
  13. added
    B-upstream
    and removed
    B-upstream
    on Aug 31, 2026
  14. added
    B-upstream
    and removed
    B-upstream
    on Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-upstreamC-performance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions