Skip to content

Commit

Permalink
Merge #907
Browse files Browse the repository at this point in the history
907: Update crossbeam-channel benchmarks r=arthurprs a=yjhn

Changes:
- updated dependencies
- updated README instructions and results
- removed `chan` benchmarks because `chan` is unmaintained since 2018
- added `flume` to the plot; I tried to include other libraries as well, but that makes graphs overlap:
![plot_example](https://user-images.githubusercontent.com/54238857/189514011-7796b2f4-f88c-418c-82ee-ea47f109bea3.png)

Co-authored-by: yjhn <[email protected]>
  • Loading branch information
bors[bot] and yjhn authored Nov 17, 2022
2 parents 0a14e12 + f92f8c3 commit 9f13ab2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 219 deletions.
12 changes: 3 additions & 9 deletions crossbeam-channel/benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ edition = "2018"
publish = false

[dependencies]
atomicring = "1.1.1"
bus = "2.0.1"
chan = "0.1.23"
atomicring = "1.2.9"
bus = "2.3.0"
crossbeam = { path = "../.." }
crossbeam-channel = { path = ".." }
crossbeam-deque = { path = "../../crossbeam-deque" }
flume = "0.10"
futures = { version = "0.3", features = ["thread-pool"] }
lockfree = "0.5.1"
mpmc = "0.1.5"
mpmc = "0.1.6"

[[bin]]
name = "atomicring"
Expand All @@ -31,11 +30,6 @@ name = "bus"
path = "bus.rs"
doc = false

[[bin]]
name = "chan"
path = "chan.rs"
doc = false

[[bin]]
name = "crossbeam-channel"
path = "crossbeam-channel.rs"
Expand Down
14 changes: 7 additions & 7 deletions crossbeam-channel/benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ Runs benchmarks, stores results into `*.txt` files, and generates `plot.png`:

Dependencies:

- Rust (nightly)
- Rust
- Go
- Bash
- Python 2
- Python
- Matplotlib

### Results

Machine: Intel(R) Core(TM) i7-5600U (2 physical cores, 4 logical cores)
Machine: Intel(R) Core(TM) i7-5500U (2 physical cores, 4 logical cores)

Rust: `rustc 1.33.0-nightly (a7be40c65 2018-12-26)`
Rust: `rustc 1.63.0 (4b91a6ea7 2022-08-08)`

Go: `go version go1.11.1 linux/amd64`
Go: `go version go1.19 linux/amd64`

Commit: `779bae9` (2018-12-30)
Commit: `7070018` (2022-08-24)

![Benchmark results](https://i.imgur.com/KFb9GvV.png)
![Benchmark results](plot.png)
201 changes: 0 additions & 201 deletions crossbeam-channel/benchmarks/chan.rs

This file was deleted.

Binary file added crossbeam-channel/benchmarks/plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion crossbeam-channel/benchmarks/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def plot(results, fig, subplot, title, prefix):

def plot_all(results, descriptions, labels):
fig = plt.figure(figsize=(10, 10))
# TODO support more number subplots
# TODO support more subplots
subplot = [221, 222, 223, 224]
for p, d, l in zip(subplot, descriptions, labels):
plot(results, fig, p, d, l)
Expand Down
14 changes: 13 additions & 1 deletion crossbeam-channel/benchmarks/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"

cargo run --release --bin chan | tee chan.txt
cargo run --release --bin crossbeam-channel | tee crossbeam-channel.txt
cargo run --release --bin futures-channel | tee futures-channel.txt
cargo run --release --bin mpsc | tee mpsc.txt
cargo run --release --bin flume | tee flume.txt
go run go.go | tee go.txt

# These can also be run, but too many plot bars mess
# up the plot (they start to overlap). So only 5 contenders
# with the most tests are included by default.

# cargo run --release --bin atomicringqueue | tee atomicringqueue.txt
# cargo run --release --bin atomicring | tee atomicring.txt
# cargo run --release --bin bus | tee bus.txt
# cargo run --release --bin crossbeam-deque | tee crossbeam-deque.txt
# cargo run --release --bin lockfree | tee lockfree.txt
# cargo run --release --bin segqueue | tee segqueue.txt
# cargo run --release --bin mpmc | tee mpmc.txt

./plot.py ./*.txt

0 comments on commit 9f13ab2

Please sign in to comment.