perfecthash: A perfect hashing library for mapping bytestrings to values.

[ bsd3, data, data-structures, library ] [ Propose Tags ] [ Report a vulnerability ]

A perfect hashing library for mapping bytestrings to values. Insertion is not supported (by design): Only fromList and lookup operations are supported. CI at https://travis-ci.org/mwotton/PerfectHash


[Skip to Readme]

Modules

  • Data
    • Data.PerfectHash

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2.0
Dependencies array, base (>=4.5 && <5.2), bytestring, cmph, containers, time [details]
License BSD-3-Clause
Author Mark Wotton <mwotton@gmail.com>
Maintainer Mark Wotton <mwotton@gmail.com>
Category Data, Data Structures
Bug tracker mailto:mwotton@gmail.com
Source repo head: git clone http://github.com/mwotton/PerfectHash.git
Uploaded by MarkWotton at 2016-05-02T13:17:56Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 902 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-11-26 [all 3 reports]

Readme for perfecthash-0.2.0

[back to package description]
This is an immutable hashtable built on cmph.

The motivation is mostly speed, and wren thornton's bytestring-trie seems to be the main competition:

% ./dist/build/benchmark_trie/benchmark_trie
* trie lookup:   1.136ns per iteration / 880403.98 per second.

% ./dist/build/benchmark/benchmark          
* perfect lookup:   0.687ns per iteration / 1456455.69 per second.

it also uses less space in the haskell heap, building once and doing the same number of lookups:

PerfectHash:
	total alloc = 2,525,223,964 bytes  (excludes profiling overheads)

Trie:
	total alloc = 9,806,202,096 bytes  (excludes profiling overheads)

although this is not an entirely fair comparison given how much PerfectHash stores on the C side.