Skip to content

Commit 867db72

Browse files
authored
Merge pull request #716 from atouchet/rdm
Update Readme
2 parents 7564121 + 57b760b commit 867db72

1 file changed

Lines changed: 29 additions & 20 deletions

File tree

README.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
hashbrown
2-
=========
1+
# hashbrown
32

43
[![Build Status](https://github.com/rust-lang/hashbrown/actions/workflows/rust.yml/badge.svg)](https://github.com/rust-lang/hashbrown/actions)
5-
[![Crates.io](https://img.shields.io/crates/v/hashbrown.svg)](https://crates.io/crates/hashbrown)
4+
[![crates.io](https://img.shields.io/crates/v/hashbrown.svg)](https://crates.io/crates/hashbrown)
65
[![Documentation](https://docs.rs/hashbrown/badge.svg)](https://docs.rs/hashbrown)
76
[![Rust](https://img.shields.io/badge/rust-1.85.0%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/hashbrown)
87

9-
This crate is a Rust port of Google's high-performance [SwissTable] hash
10-
map, adapted to make it a drop-in replacement for Rust's standard `HashMap`
11-
and `HashSet` types.
8+
This crate is a Rust port of Google's high-performance [SwissTable] hash map,
9+
adapted to make it a drop-in replacement for Rust's standard `HashMap` and
10+
`HashSet` types.
1211

1312
The original C++ version of SwissTable can be found [here], and this
1413
[CppCon talk] gives an overview of how the algorithm works.
1514

1615
Since Rust 1.36, the Rust standard library has adopted this implementation for
17-
`HashMap`, using its own default hasher (see [`std::hash::DefaultHasher`](https://doc.rust-lang.org/std/hash/struct.DefaultHasher.html)).
16+
`HashMap`, using its own default hasher (see
17+
[`std::hash::DefaultHasher`](https://doc.rust-lang.org/std/hash/struct.DefaultHasher.html)).
1818
However you may still want to use this crate instead since it works in
1919
environments without `std`, such as embedded systems and kernels.
2020

@@ -27,11 +27,14 @@ environments without `std`, such as embedded systems and kernels.
2727
## Features
2828

2929
- Drop-in replacement for the standard library `HashMap` and `HashSet` types.
30-
- Uses [foldhash](https://github.com/orlp/foldhash) as the default hasher, which is much faster than SipHash.
31-
However, foldhash does *not provide the same level of HashDoS resistance* as SipHash, so if that is important to you, you might want to consider using a different hasher.
30+
- Uses [foldhash](https://github.com/orlp/foldhash) as the default hasher, which
31+
is much faster than SipHash. However, foldhash does *not provide the same
32+
level of HashDoS resistance* as SipHash, so if that is important to you, you
33+
might want to consider using a different hasher.
3234
- Around 2x faster than the previous standard library `HashMap`.
3335
- Lower memory usage: only 1 byte of overhead per entry instead of 8.
34-
- Compatible with `#[no_std]` (but requires a global allocator with the `alloc` crate).
36+
- Compatible with `#[no_std]` (but requires a global allocator with the `alloc`
37+
crate).
3538
- Empty hash maps do not allocate any memory.
3639
- SIMD lookups to scan multiple hash entries in parallel.
3740

@@ -41,7 +44,7 @@ Add this to your `Cargo.toml`:
4144

4245
```toml
4346
[dependencies]
44-
hashbrown = "0.16"
47+
hashbrown = "0.17"
4548
```
4649

4750
Then:
@@ -54,29 +57,35 @@ map.insert(1, "one");
5457
```
5558

5659
## Flags
60+
5761
This crate has the following Cargo features:
5862

5963
- `nightly`: Enables nightly-only features including: `#[may_dangle]`.
6064
- `serde`: Enables serde serialization support.
6165
- `rayon`: Enables rayon parallel iterator support.
62-
- `equivalent`: Allows comparisons to be customized with the `Equivalent` trait. (enabled by default)
66+
- `equivalent`: Allows comparisons to be customized with the `Equivalent` trait.
67+
(enabled by default)
6368
- `raw-entry`: Enables access to the deprecated `RawEntry` API.
64-
- `inline-more`: Adds inline hints to most functions, improving run-time performance at the cost
65-
of compilation time. (enabled by default)
66-
- `default-hasher`: Compiles with foldhash as default hasher. (enabled by default)
67-
- `allocator-api2`: Enables support for allocators that support `allocator-api2`. (enabled by default)
69+
- `inline-more`: Adds inline hints to most functions, improving run-time
70+
performance at the cost of compilation time. (enabled by default)
71+
- `default-hasher`: Compiles with foldhash as default hasher. (enabled by
72+
default)
73+
- `allocator-api2`: Enables support for allocators that support
74+
`allocator-api2`. (enabled by default)
6875

6976
## License
7077

7178
Licensed under either of:
7279

73-
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
74-
* MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
80+
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
81+
https://www.apache.org/licenses/LICENSE-2.0)
82+
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
83+
https://opensource.org/license/mit)
7584

7685
at your option.
7786

7887
### Contribution
7988

8089
Unless you explicitly state otherwise, any contribution intentionally submitted
81-
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
82-
additional terms or conditions.
90+
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
91+
dual licensed as above, without any additional terms or conditions.

0 commit comments

Comments
 (0)