|
3 | 3 | [](https://crates.io/crates/rayon-hash)
|
4 | 4 | [](https://docs.rs/rayon-hash)
|
5 | 5 | [](https://travis-ci.org/rayon-rs/rayon-hash)
|
| 6 | + |
6 | 7 |
|
7 |
| -The `rayon-hash` crate duplicates the standard `HashMap` and `HashSet`, adding |
8 |
| -native support for Rayon parallel iterators. |
| 8 | +This crate is now **deprecated**, because the [new implementation in `std`] |
| 9 | +also exists as the [`hashbrown`] crate with its own "rayon" feature. |
| 10 | + |
| 11 | +[new implementation in `std`]: https://github.com/rust-lang/rust/pull/58623 |
| 12 | +[`hashbrown`]: https://crates.io/crates/hashbrown |
| 13 | + |
| 14 | +The `rayon-hash` crate duplicates the _former_ standard `HashMap` and |
| 15 | +`HashSet`, adding native support for Rayon parallel iterators. |
9 | 16 |
|
10 | 17 | Rayon does provide iterators for these standard types already, but since it
|
11 | 18 | can't access internal fields, it has to collect to an intermediate vector to be
|
12 | 19 | split into parallel jobs. With the custom types in `rayon-hash`, we can
|
13 | 20 | instead read the raw hash table directly, for much better performance.
|
14 | 21 |
|
| 22 | +Benchmarks using `rustc 1.36.0-nightly (e938c2b9a 2019-04-23)`, before the |
| 23 | +`hashbrown` implementation had merged into `std`: |
| 24 | + |
15 | 25 | ```text
|
16 |
| -test rayon_set_sum_parallel ... bench: 1,035,111 ns/iter (+/- 57,327) |
17 |
| -test rayon_set_sum_serial ... bench: 7,500,179 ns/iter (+/- 96,918) |
18 |
| -test std_set_sum_parallel ... bench: 6,799,231 ns/iter (+/- 94,154) |
19 |
| -test std_set_sum_serial ... bench: 7,634,174 ns/iter (+/- 84,806) |
| 26 | +test hashbrown_set_sum_parallel ... bench: 617,405 ns/iter (+/- 58,565) |
| 27 | +test hashbrown_set_sum_serial ... bench: 2,655,882 ns/iter (+/- 15,104) |
| 28 | +test rayon_hash_set_sum_parallel ... bench: 1,368,058 ns/iter (+/- 75,984) |
| 29 | +test rayon_hash_set_sum_serial ... bench: 7,558,175 ns/iter (+/- 190,545) |
| 30 | +test std_hash_set_sum_parallel ... bench: 6,869,490 ns/iter (+/- 47,897) |
| 31 | +test std_hash_set_sum_serial ... bench: 7,591,704 ns/iter (+/- 154,438) |
20 | 32 | ```
|
21 | 33 |
|
22 |
| -This crate currently requires `rustc 1.28.0` or greater. |
| 34 | +This crate currently requires `rustc 1.31.0` or greater. |
23 | 35 |
|
24 | 36 | ## Known limitations
|
25 | 37 |
|
|
0 commit comments