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

Release 0.5.0, deprecated #25

Merged
merged 40 commits into from
Apr 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b50560e
Add example of using the indexing operator to HashMap docs
fhartwig Oct 30, 2018
6e574a5
Clarifying documentation for collections::hash_map::Entry::or_insert
meltinglava Nov 8, 2018
571d16c
constify parts of libstd.
Centril Oct 23, 2018
f68d846
reduce list to functions callable in const ctx.
Centril Oct 23, 2018
96e3bf5
revert making internal APIs const fn.
Centril Oct 23, 2018
a5006f2
The example values are now easyer to differenciate
meltinglava Nov 13, 2018
151fe7e
fix various typos in doc comments
euclio Nov 12, 2018
58f9c94
Auto merge of #55974 - pietroalbini:rollup, r=pietroalbini
bors Nov 15, 2018
d3fd2e6
Rollup merge of #55784 - meltinglava:master, r=KodrAus
GuillaumeGomez Nov 22, 2018
49c2ff9
Fix the tracking issue for hash_raw_entry
sfackler Nov 22, 2018
548b6bb
Inline things
Zoxc Nov 29, 2018
4f85afb
Update issue number of `shrink_to` methods to point the tracking issue
ordovicia Dec 2, 2018
a2964fa
Replace usages of `..i + 1` ranges with `..=i`.
frewsxcv Dec 4, 2018
5c2b31c
Fix bug in from_key_hashed_nocheck
Zoxc Dec 6, 2018
4df14f0
Rollup merge of #56561 - Zoxc:too-raw, r=Gankro
kennytm Dec 7, 2018
cbfbd43
Various minor/cosmetic improvements to code
alexreg Nov 27, 2018
0950cce
Inline tweaks
Zoxc Dec 5, 2018
4d9776b
Fix poor worst case performance of set intersection (and union, somew…
ssomers Dec 21, 2018
b149f14
Fixed typo in HashMap documentation
RyanMarcus Dec 21, 2018
dfebe45
Rollup merge of #57050 - RyanMarcus:master, r=zackmdavis
kennytm Dec 22, 2018
5f079fb
Remove licenses
Mark-Simulacrum Dec 25, 2018
8774e02
Auto merge of #55519 - fhartwig:hashmap-index-example, r=Centril
bors Dec 28, 2018
7cccb98
Fix repeated word typos
wikku Jan 3, 2019
27d354b
Merge remote-tracking branch 'upstream/master'
ssomers Jan 9, 2019
eb0a1a6
Fix poor worst case performance of is_disjoint
ssomers Jan 9, 2019
621aaca
libs: doc comments
alexreg Feb 9, 2019
f9a22f5
Relax some Hash bounds on HashMap<K, V, S> and HashSet<T, S>
nox Feb 11, 2019
a031a01
Use more impl header lifetime elision
scottmcm Feb 18, 2019
32d6b2f
Rollup merge of #58553 - scottmcm:more-ihle, r=Centril
kennytm Feb 19, 2019
4aae70a
Rollup merge of #58370 - nox:relax-bounds, r=dtolnay
Centril Feb 25, 2019
6bc23d7
libstd => 2018
taiki-e Feb 10, 2019
7bccb91
Make the Entry API of HashMap<K, V> Sync and Send (fixes #45219)
nox Feb 10, 2019
056a093
Rollup merge of #58369 - nox:sync-hash-map-entry, r=Amanieu
pietroalbini Mar 8, 2019
ac04cad
Use lifetime contravariance to elide more lifetimes in core+alloc+std
scottmcm Mar 10, 2019
488c654
Improvements to comments in libstd, libcore, liballoc.
alexreg Feb 9, 2019
845f987
Rollup merge of #59082 - alexreg:cosmetic-2-doc-comments, r=Centril
kennytm Mar 16, 2019
46294d4
libstd: deny(elided_lifetimes_in_paths)
Centril Mar 1, 2019
7d3ea07
improve worst-case performance of HashSet.is_subset
ssomers Apr 3, 2019
c00f3e1
git subtree pull && 2018 edition!
cuviper Apr 24, 2019
d0e7915
Release 0.5.0, deprecated
cuviper Apr 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 10 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
[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"

[dependencies]
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}
4 changes: 4 additions & 0 deletions src/intrinsics.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#[inline(always)]
pub unsafe fn unlikely(b: bool) -> bool {
b
}
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ extern crate rayon;
#[cfg(test)] extern crate rand;

mod alloc;
#[cfg(rayon_hash_unstable)]
mod intrinsics;
mod ptr;

// #[stable(feature = "rust1", since = "1.0.0")]
Expand Down
2 changes: 1 addition & 1 deletion src/par/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rayon::iter::{FromParallelIterator, IntoParallelIterator, ParallelExtend, Pa
use std::hash::{BuildHasher, Hash};

use super::table;
use HashMap;
use crate::HashMap;

pub use self::table::{ParIntoIter, ParIter, ParIterMut};
pub use self::table::{ParKeys, ParValues, ParValuesMut};
Expand Down
2 changes: 1 addition & 1 deletion src/par/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rayon::iter::{FromParallelIterator, IntoParallelIterator, ParallelExtend, Pa
use std::hash::{BuildHasher, Hash};

use super::map;
use HashSet;
use crate::HashSet;

pub struct ParIntoIter<T: Send> {
inner: map::ParIntoIter<T, ()>,
Expand Down
2 changes: 1 addition & 1 deletion src/par/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::ptr;
use rayon::iter::plumbing::*;
use rayon::prelude::*;

use std_hash::table::{RawBucket, RawTable};
use crate::std_hash::table::{RawBucket, RawTable};

struct SplitBuckets<'a, K, V> {
bucket: RawBucket<K, V>,
Expand Down
Loading