Skip to content

Use crossbeam-channel instead of std::sync::mpsc#335

Merged
frankmcsherry merged 1 commit intoTimelyDataflow:masterfrom
benesch:crossbeam-channels
Aug 6, 2020
Merged

Use crossbeam-channel instead of std::sync::mpsc#335
frankmcsherry merged 1 commit intoTimelyDataflow:masterfrom
benesch:crossbeam-channels

Conversation

@benesch
Copy link
Copy Markdown
Contributor

@benesch benesch commented Aug 6, 2020

See MaterializeInc/materialize#3870 for the context. I admit this might be scary and a totally bad idea!

There are two reasons motivating this change:

  • Crossbeam senders implement the Sync trait. This is particularly
    useful for the SyncActivator. It is much more ergonomic if the
    SyncActivator implements the Sync trait, which is only possible if
    the contained channel transmitter itself implements Sync.

  • Crossbeam channels seem faster. A very simple benchmark via

    $ cargo run --example exchange --release -- 10000 10000 -w2
    

    decreases from 604ms to 568ms.

There are two reasons motivating this change:

* Crossbeam senders implement the `Sync` trait. This is particularly
  useful for the `SyncActivator`. It is much more ergonomic if the
  `SyncActivator` implements the `Sync` trait, which is only possible if
  the contained channel transmitter itself implements `Sync`.

* Crossbeam channels seem faster. A very simple benchmark via

      $ cargo run --example exchange --release -- 10000 10000 -w2

  decreases from 604ms to 568ms.
Copy link
Copy Markdown
Member

@frankmcsherry frankmcsherry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all seems good to me. If we get any word back about crossbeam shortcomings we can re-evaluate, but in their absence this seems like a strict improvement.

@frankmcsherry frankmcsherry merged commit 316a617 into TimelyDataflow:master Aug 6, 2020
@benesch benesch deleted the crossbeam-channels branch January 8, 2021 04:57
@github-actions github-actions bot mentioned this pull request Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants