You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-13Lines changed: 17 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ this to write Rust programs with low-latency message passing.
9
9
Add this to your `Cargo.toml`:
10
10
```TOML
11
11
[dependencies]
12
-
fq = "0.0.2"
12
+
fq = "0.0.3"
13
13
```
14
14
15
15
## Quickstart
@@ -35,30 +35,35 @@ receiver.join().expect("The receiver thread has panicked");
35
35
```
36
36
37
37
## Examples
38
-
See the [examples](examples) directory for more usage examples.
38
+
See the [examples](examples/README.md) directory for more usage examples.
39
39
40
40
## How does it work?
41
-
The ring buffer structure allows for a contigous data structure. The idea is that if we are able to get extreme
41
+
The ring buffer structure allows for a contiguous data structure. The idea is that if we are able to get extreme
42
42
cache locality, we can improve performance by reducing cache misses. This is also the reason why if you use
43
-
smart pointers like `Box<T>`, performance *may* degrade since cache locality gets affected. For very large
43
+
smart pointers like `Box<T>`, performance *may* degrade since cache locality gets degraded. For very large
44
44
`T` types, you are more limited by `memcpy()` performance and less from queue implementations. As such,
45
-
ring buffers can be considered strongly optimized for data of a few word sizes with some non-linear
45
+
ring buffers can be considered strongly optimized for data of a few word sizes with some non-linear performance
46
46
degradation for larger sizes. Additional optimizations are provided for CPUs that support `sse` and `prfchw`
47
-
flags. As and when Rust `std` provides more relevant instructions, they will be added. This is simply a
47
+
instructions. As and when Rust `std` provides more relevant instructions, they will be added. This is simply a
48
48
high-level explanation of some of the techniques employed by this crate, you can read the code to gain a better
49
49
understanding of what's happening under the hood.
50
50
51
+
## Profiles
52
+
The crate is fully synchronous and runtime-agnostic. We are heavily reliant on `std` for memory management, so
53
+
it's unlikely that we will support `#[no_std]` runtimes anytime soon. You should be using the `release` or
54
+
`maxperf` profiles for optimal performance.
55
+
51
56
## Principles
52
57
* This crate will always prioritize message throughput over memory usage.
53
-
* This crate will always support generic types only.
58
+
* This crate will always support generic types.
54
59
* This crate will always provide a wait-free **and** lock-free API.
55
60
* This crate will use unsafe Rust where possible for maximal throughput.
56
61
57
62
## Benchmarks
58
63
Benchmarks are strictly difficult due to the nature of the program, it's somewhat simple to do a same-CPU
59
64
bench but performance will still be affected based on the core type and cache contention. Benchmarks are
60
-
provided in the [benchmark](benchmark) directory and can be run with `cargo bench`. Contributions via PRs for
61
-
additional benchmarks are welcome.
65
+
provided in the [benches](benches/bench.rs) directory and can be run with `cargo bench`. Contributions via
66
+
PRs for additional benchmarks are welcome.
62
67
63
68
## License
64
69
Licensed under either of:
@@ -67,9 +72,8 @@ Licensed under either of:
67
72
at your option.
68
73
69
74
### Contribution
70
-
Unless you explicitly state otherwise, any contribution intentionally submitted
71
-
for inclusion in the work by you, as defined in the LGPL-3.0 license, shall be dual licensed as above, without any
72
-
additional terms or conditions.
75
+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you,
76
+
as defined in the LGPL-3.0 license, shall be dual licensed as above, without any additional terms or conditions.
73
77
74
78
## Acknowledgements
75
-
Inspired from previous works like[fastqueue2](https://github.com/andersc/fastqueue2), [rigtorp](https://rigtorp.se/ringbuffer) and [rtrb](https://github.com/mgeier/rtrb).
79
+
Inspired from the previous works of[fastqueue2](https://github.com/andersc/fastqueue2), [rigtorp](https://rigtorp.se/ringbuffer) and [rtrb](https://github.com/mgeier/rtrb).
0 commit comments