Skip to content
Draft
Changes from all commits
Commits
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
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,44 @@ performance critical use, both in terms of large data quantities and high speed.
The declared cost of each operation is either worst-case or amortized, but
remains valid even if structures are shared.

### How to get the best performance out of this package

#### Enable hardware support for `popCount`

This package makes heavy use of the `popCount` function. To allow GHC to use the
`popcnt` instruction available on modern x86 and x86-64 platforms, enable GHC's
`-msse4.2` option. Since code from `unordered-containers` may spread to other
packages due to inlining and specialization, it's best to use this setting for
all packages in your project:

In your `cabal.project`:

```
package *
ghc-options: -msse4.2
```

In your `stack.yaml`:

```
ghc-options:
"$everything": -msse4.2
```

#### Make sure that your keys have a good hash distribution

TODO (few collisions, good HAMT shape)

#### Make sure that your keys' `hash` method is fast

TODO

#### Make sure that your keys' `(==)` method is fast

TODO (pointer equality!)
Comment on lines +41 to +43
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #77.


### More documentation

For background information and design considerations on this package see the
[Developer Guide](docs/developer-guide.md).

Expand Down