https://github.com/gregorycollins/hashtables

Last synced: about 1 month ago

Repository metadata:

Mutable hash tables for Haskell, in the ST monad


Owner metadata:


Committers metadata

Last synced: about 1 month ago

Total Commits: 121
Total Committers: 23
Avg Commits per committer: 5.261
Development Distribution Score (DDS): 0.529

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Gregory Collins g****g@g****t 57
Erik de Castro Lopo e****d@m****m 12
Carter Tazio Schonwald c****d@g****m 9
Andreas Abel a****l@i****e 7
Vykintas Baltrušaitis v****l@g****m 5
Franklin Chen f****n@f****m 3
Iavor S. Diatchki d****i@g****m 3
Rob Everest r****t@g****m 3
Vladimir Kochnev h****e@y****u 3
Vykintas Baltrušaitis v****s@m****t 3
Andy Morris h****o@a****z 2
Ben Gamari b****s@g****m 2
M.G.Meier m****r@g****m 2
Andrés Sicard-Ramírez a****r@e****o 1
Brent Yorgey b****y@g****m 1
Eric Mertens e****s@g****m 1
Frederik Hanghøj Iversen f****0@g****m 1
Fumiaki Kinoshita f****l@g****m 1
Gregory Collins g****g@s****m 1
James Koppel j****l@y****m 1
Keshav Kini k****i@g****m 1
Thijs Alkemade me@t****e 1
Vanessa McHale v****e@g****m 1

Issue and Pull Request metadata

Last synced: about 1 month ago


Package metadata

hackage: hashtables

This package provides a couple of different implementations of mutable hash tables in the ST monad, as well as a typeclass abstracting their common operations, and a set of wrappers to use the hash tables in the IO monad. QUICK START: documentation for the hash table operations is provided in the Data.HashTable.Class module, and the IO wrappers (which most users will probably prefer) are located in the Data.HashTable.IO module. This package currently contains three hash table implementations: Data.HashTable.ST.Cuckoo contains an implementation of "cuckoo hashing" as introduced by Pagh and Rodler in 2001 (see http://en.wikipedia.org/wiki/Cuckoo_hashing). Cuckoo hashing has worst-case O(1) lookups and can reach a high "load factor", in which the table can perform acceptably well even when approaching 90% full. Randomized testing shows this implementation of cuckoo hashing to be slightly faster on insert and slightly slower on lookup than Data.HashTable.ST.Basic, while being more space efficient by about a half-word per key-value mapping. Cuckoo hashing, like the basic hash table implementation using linear probing, can suffer from long delays when the table is resized. Data.HashTable.ST.Basic contains a basic open-addressing hash table using linear probing as the collision strategy. On a pure speed basis it should currently be the fastest available Haskell hash table implementation for lookups, although it has a higher memory overhead than the other tables and can suffer from long delays when the table is resized because all of the elements in the table need to be rehashed. Data.HashTable.ST.Linear contains a linear hash table (see http://en.wikipedia.org/wiki/Linear_hashing), which trades some insert and lookup performance for higher space efficiency and much shorter delays when expanding the table. In most cases, benchmarks show this table to be currently slightly faster than Data.HashTable from the Haskell base library. It is recommended to create a concrete type alias in your code when using this package, i.e.: Firstly, this makes it easy to switch to a different hash table implementation, and secondly, using a concrete type rather than leaving your functions abstract in the HashTable class should allow GHC to optimize away the typeclass dictionaries. This package accepts a couple of different cabal flags: unsafe-tricks, default ON. If this flag is enabled, we use some unsafe GHC-specific tricks to save indirections (namely unsafeCoerce# and reallyUnsafePtrEquality#. These techniques rely on assumptions about the behaviour of the GHC runtime system and, although they've been tested and should be safe under normal conditions, are slightly dangerous. Caveat emptor. In particular, these techniques are incompatible with HPC code coverage reports. sse42, default OFF. If this flag is enabled, we use some SSE 4.2 instructions (see http://en.wikipedia.org/wiki/SSE4, first available on Intel Core 2 processors) to speed up cache-line searches for cuckoo hashing. bounds-checking, default OFF. If this flag is enabled, array accesses are bounds-checked. debug, default OFF. If turned on, we'll rudely spew debug output to stdout. portable, default OFF. If this flag is enabled, we use only pure Haskell code and try not to use unportable GHC extensions. Turning this flag on forces unsafe-tricks and sse42 OFF. Please send bug reports to https://github.com/gregorycollins/hashtables/issues.

  • Homepage: http://github.com/gregorycollins/hashtables
  • Licenses: BSD-3-Clause
  • Latest release: 1.3.1 (published about 2 years ago)
  • Last Synced: 2024-11-11T03:09:53.347Z (about 1 month ago)
  • Versions: 32
  • Dependent Packages: 25
  • Dependent Repositories: 279
  • Downloads: 101,415 Total
  • Docker Downloads: 35
  • Rankings:
    • Docker downloads count: 0.175%
    • Dependent packages count: 1.136%
    • Downloads: 1.3%
    • Dependent repos count: 1.464%
    • Average: 3.004%
    • Forks count: 6.471%
    • Stargazers count: 7.477%
  • Maintainers (3)

Dependencies

benchmark/hashtable-benchmark.cabal hackage
  • Chart ==0.14.*
  • base ==4.*
  • base16-bytestring ==0.1.*
  • bytestring >=0.9 && <0.11
  • colour ==2.3.*
  • containers >=0.4 && <0.6
  • criterion ==1.2.*
  • csv ==0.1.*
  • data-accessor ==0.2.*
  • deepseq >=1.1 && <1.5
  • filepath ==1.*
  • hashable ==1.1.* || >=1.2.1 && <1.3
  • hashtables ==1.2.*
  • mtl ==2.*
  • mwc-random >=0.8 && <0.14
  • primitive *
  • statistics ==0.14.*
  • threads >=0.4 && <0.6
  • unordered-containers ==0.2.*
  • vector >=0.7 && <0.13
  • vector-algorithms >=0.5 && <0.8
hashtables.cabal hackage
  • base >=4.7 && <5
  • ghc-prim *
  • hashable ==1.4.*
  • primitive *
  • vector >=0.7 && <0.13
  • HUnit >=1.2 && <2 test
  • QuickCheck >=2.3.0.2 test
  • base ==4.* test
  • ghc-prim * test
  • hashable ==1.4.* test
  • mwc-random >=0.8 && <0.16 test
  • primitive * test
  • test-framework >=0.3.1 && <0.9 test
  • test-framework-hunit >=0.2.6 && <3 test
  • test-framework-quickcheck2 >=0.2.6 && <0.4 test
  • vector >=0.7 test
test/hashtables-test.cabal hackage
  • HUnit >=1.2 && <2
  • QuickCheck >=2.3.0.2 && <3
  • base ==4.*
  • ghc-prim *
  • hashable ==1.1.* || >=1.2.1 && <1.3
  • mwc-random >=0.8 && <0.14
  • primitive *
  • statistics ==0.14.*
  • test-framework >=0.3.1 && <0.9
  • test-framework-hunit >=0.2.6 && <3
  • test-framework-quickcheck2 >=0.2.6 && <0.4
  • vector >=0.7
.github/workflows/haskell-ci.yml actions
  • actions/cache/restore v3 composite
  • actions/cache/save v3 composite
  • actions/checkout v3 composite