https://github.com/sile/nbchan
Highly optimized non-blocking communication channels implemented in Rust
https://github.com/sile/nbchan
asynchronous concurrency non-blocking rust
Last synced: 4 months ago
JSON representation
Highly optimized non-blocking communication channels implemented in Rust
- Host: GitHub
- URL: https://github.com/sile/nbchan
- Owner: sile
- License: mit
- Created: 2017-05-07T16:24:31.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-21T03:43:32.000Z (almost 8 years ago)
- Last Synced: 2025-10-05T13:09:57.152Z (9 months ago)
- Topics: asynchronous, concurrency, non-blocking, rust
- Language: Rust
- Homepage:
- Size: 17.6 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
nbchan
======
[](https://crates.io/crates/nbchan)
[](https://docs.rs/nbchan)
[](https://travis-ci.org/sile/nbchan)
[](https://codecov.io/gh/sile/nbchan/branch/master)
[](LICENSE)
Highly optimized non-blocking communication channels implemented in Rust.
[Documentation](https://docs.rs/nbchan)
Informal Benchmarks
--------------------
The version of `nbchan` is `v0.1.0`:
```sh
$ cat /etc/lsb-release | tail -1
DISTRIB_DESCRIPTION="Ubuntu 17.04"
$ cat /proc/cpuinfo | grep 'model name'
model name : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
model name : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
model name : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
model name : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
$ rustup run nightly rustc -V
rustc 1.18.0-nightly (036983201 2017-04-26)
$ rustup run nightly cargo bench
running 8 tests
test create_nbchan_oneshot ... bench: 23 ns/iter (+/- 1)
test create_std_mpsc ... bench: 64 ns/iter (+/- 6)
test failure_send_nbchan_oneshot ... bench: 40 ns/iter (+/- 1)
test failure_send_std_mpsc ... bench: 85 ns/iter (+/- 6)
test multithread_send_recv_nbchan_oneshot ... bench: 71 ns/iter (+/- 19)
test multithread_send_recv_std_mpsc ... bench: 108 ns/iter (+/- 53)
test send_recv_nbchan_oneshot ... bench: 35 ns/iter (+/- 4)
test send_recv_std_mpsc ... bench: 82 ns/iter (+/- 3)
test result: ok. 0 passed; 0 failed; 0 ignored; 8 measured
```
```sh
$ cargo run --example channel_size
nbchan::oneshot::Sender<()>: 8 bytes
nbchan::oneshot::Receiver<()>: 8 bytes
std::sync::mpsc::Sender<()>: 16 bytes
std::sync::mpsc::Receiver<()>: 16 bytes
```