The PerfectHash package

[Tags: bsd3, library]

A perfect hashing library for mapping bytestrings to values. Insertion is not supported (by design): this is just a binding to the C-based CMPH library (http:cmph.sf.net). Only fromList and lookup operations are supported, but in many circumstances this is all that's required.


[Skip to ReadMe]

Properties

Versions0.1, 0.1.1, 0.1.2, 0.1.3, 0.1.4
Change logNone available
Dependenciesarray, base, bytestring, bytestring-trie, containers, digest, haskell98, HUnit, QuickCheck, time [details]
LicenseBSD3
AuthorMark Wotton <mwotton@gmail.com>
MaintainerMark Wotton <mwotton@gmail.com>
StabilityExperimental
CategoryData, Data Structures
Bug trackermailto:mwotton@gmail.com
Executablestest, benchmark_trie, benchmark
UploadedMon Jan 26 00:28:01 UTC 2009 by MarkWotton
DistributionsNixOS:0.1.4
Downloads967 total (31 in last 30 days)
Votes
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for PerfectHash-0.1

This is a thin haskell wrapper around the CMPH library, obtainable at http://cmph.sf.net.
I assume you have it installed in /usr/local/lib.

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.