Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Commit

Permalink
Release 0.5.0, deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Apr 25, 2019
1 parent c00f3e1 commit d0e7915
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: false
matrix:
fast_finish: true
include:
- rust: 1.28.0
- rust: 1.31.0
- rust: stable
- rust: beta
- rust: nightly
Expand Down
11 changes: 9 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
authors = ["Josh Stone <cuviper@gmail.com>"]
name = "rayon-hash"
version = "0.4.1"
version = "0.5.0"
repository = "https://github.com/rayon-rs/rayon-hash"
documentation = "https://docs.rs/rayon-hash/"
keywords = ["parallel", "iterator", "hash", "map", "set"]
categories = ["concurrency", "data-structures"]
description = "HashMap and HashSet with support for Rayon parallel iterators"
description = "(deprecated) HashMap and HashSet with support for Rayon parallel iterators"
license = "Apache-2.0/MIT"
readme = "README.md"
edition = "2018"
Expand All @@ -17,3 +17,10 @@ rayon = "1.0"
[dev-dependencies]
rand = "0.6"
rand_xorshift = "0.1"

[dev-dependencies.hashbrown]
version = "0.3.0"
features = ["rayon"]

[badges]
maintenance = { status = "deprecated" }
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,35 @@
[![rayon-hash crate](https://img.shields.io/crates/v/rayon-hash.svg)](https://crates.io/crates/rayon-hash)
[![rayon-hash documentation](https://docs.rs/rayon-hash/badge.svg)](https://docs.rs/rayon-hash)
[![Travis Status](https://travis-ci.org/rayon-rs/rayon-hash.svg?branch=master)](https://travis-ci.org/rayon-rs/rayon-hash)
![deprecated](https://img.shields.io/badge/maintenance-deprecated-red.svg)

The `rayon-hash` crate duplicates the standard `HashMap` and `HashSet`, adding
native support for Rayon parallel iterators.
This crate is now **deprecated**, because the [new implementation in `std`]
also exists as the [`hashbrown`] crate with its own "rayon" feature.

[new implementation in `std`]: https://github.com/rust-lang/rust/pull/58623
[`hashbrown`]: https://crates.io/crates/hashbrown

The `rayon-hash` crate duplicates the _former_ standard `HashMap` and
`HashSet`, adding native support for Rayon parallel iterators.

Rayon does provide iterators for these standard types already, but since it
can't access internal fields, it has to collect to an intermediate vector to be
split into parallel jobs. With the custom types in `rayon-hash`, we can
instead read the raw hash table directly, for much better performance.

Benchmarks using `rustc 1.36.0-nightly (e938c2b9a 2019-04-23)`, before the
`hashbrown` implementation had merged into `std`:

```text
test rayon_set_sum_parallel ... bench: 1,035,111 ns/iter (+/- 57,327)
test rayon_set_sum_serial ... bench: 7,500,179 ns/iter (+/- 96,918)
test std_set_sum_parallel ... bench: 6,799,231 ns/iter (+/- 94,154)
test std_set_sum_serial ... bench: 7,634,174 ns/iter (+/- 84,806)
test hashbrown_set_sum_parallel ... bench: 617,405 ns/iter (+/- 58,565)
test hashbrown_set_sum_serial ... bench: 2,655,882 ns/iter (+/- 15,104)
test rayon_hash_set_sum_parallel ... bench: 1,368,058 ns/iter (+/- 75,984)
test rayon_hash_set_sum_serial ... bench: 7,558,175 ns/iter (+/- 190,545)
test std_hash_set_sum_parallel ... bench: 6,869,490 ns/iter (+/- 47,897)
test std_hash_set_sum_serial ... bench: 7,591,704 ns/iter (+/- 154,438)
```

This crate currently requires `rustc 1.28.0` or greater.
This crate currently requires `rustc 1.31.0` or greater.

## Known limitations

Expand Down
12 changes: 8 additions & 4 deletions benches/set_sum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ extern crate rayon;
extern crate rayon_hash;
extern crate test;

use hashbrown::HashSet as HashBrownSet;
use rand::distributions::Standard;
use rand::{Rng, SeedableRng};
use rand_xorshift::XorShiftRng;
use rayon::prelude::*;
use rayon_hash::HashSet as RayonHashSet;
use std::collections::HashSet as StdHashSet;
use std::collections::hash_map::RandomState;
use std::iter::FromIterator;
use test::Bencher;

Expand Down Expand Up @@ -39,7 +41,9 @@ macro_rules! bench_set_sum {
};
}

bench_set_sum!{std_set_sum_serial, StdHashSet<_>, iter}
bench_set_sum!{std_set_sum_parallel, StdHashSet<_>, par_iter}
bench_set_sum!{rayon_set_sum_serial, RayonHashSet<_>, iter}
bench_set_sum!{rayon_set_sum_parallel, RayonHashSet<_>, par_iter}
bench_set_sum!{std_hash_set_sum_serial, StdHashSet<_, RandomState>, iter}
bench_set_sum!{std_hash_set_sum_parallel, StdHashSet<_, RandomState>, par_iter}
bench_set_sum!{rayon_hash_set_sum_serial, RayonHashSet<_, RandomState>, iter}
bench_set_sum!{rayon_hash_set_sum_parallel, RayonHashSet<_, RandomState>, par_iter}
bench_set_sum!{hashbrown_set_sum_serial, HashBrownSet<_, RandomState>, iter}
bench_set_sum!{hashbrown_set_sum_parallel, HashBrownSet<_, RandomState>, par_iter}

0 comments on commit d0e7915

Please sign in to comment.