-
Notifications
You must be signed in to change notification settings - Fork 2
/
unagi-bloomfilter.cabal
153 lines (136 loc) · 5.35 KB
/
unagi-bloomfilter.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: unagi-bloomfilter
version: 0.1.1.2
synopsis: A fast, cache-efficient, concurrent bloom filter
description:
This library implements a fast concurrent bloom filter, based on bloom-1 from
"Fast Bloom Filters and Their Generalization" by Y Qiao, et al.
.
A bloom filter is a probabilistic, constant-space, set-like data structure
supporting insertion and membership queries. This implementation is backed by
SipHash so can safely consume untrusted inputs.
.
The implementation here compares favorably with traditional set
implementations in a single-threaded context, e.g. here are 10 inserts or
lookups compared across some sets of different sizes:
.
<<http://i.imgur.com/gei1LW4.png>>
.
With the llvm backend benchmarks take around 75-85% of the runtime of the
native code gen.
.
Unfortunately writes in particular don't seem to scale currently; i.e.
distributing writes across multiple threads may be /slower/ than in a
single-threaded context, because of memory effects. We plan to export
functionality that would support using the filter here in a concurrent
context with better memory behavior (e.g. a server that shards to a
thread-pool which handles only a portion of the bloom array).
.
<<http://i.imgur.com/RaUSmZB.png>>
.
homepage: http://github.com/jberryman/unagi-bloomfilter
license: BSD3
license-file: LICENSE
author: Brandon Simmons
maintainer: [email protected]
-- copyright:
category: Concurrency
build-type: Simple
-- extra-source-files:
cabal-version: >=1.10
source-repository head
type: git
location: https://github.com/jberryman/unagi-bloomfilter.git
Flag dev
Description: To build tests, executables and benchmarks do `configure -fdev --enable-tests` and run the built executables by hand (i.e. not with `cabal test` etc.; we put all our different executables in test-suite sections in order to hide their dependencies from hackage)
Default: False
-- TODO did this solve our issues with having executable sections and hackage deps?:
Manual: True
Flag instrumented
Description: Enables assertions in library code. When --enable-library-profiling and --enable-executable-profiling is turned on, you can get stacktraces as well
Default: False
Manual: True
library
if flag(dev)
CPP-Options: -DEXPORT_INTERNALS
if flag(instrumented)
CPP-Options: -DASSERTIONS_ON
ghc-options: -fno-ignore-asserts
-- TODO stacktraces don't seem to show anything useful. Maybe because of INLINEs?:
-- ghc-prof-options: "-with-rtsopts=-xc" -fprof-auto -fprof-auto-calls
exposed-modules: Control.Concurrent.BloomFilter
, Control.Concurrent.BloomFilter.Internal
-- other-modules:
-- other-extensions:
build-depends: base >=4.7 && <5
, atomic-primops >= 0.8
, primitive
, bytestring
, hashabler >= 1.3.0
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall -fwarn-tabs -O2 -funbox-strict-fields
test-suite tests
ghc-options: -fsimpl-tick-factor=1000
type: exitcode-stdio-1.0
default-language: Haskell2010
hs-source-dirs: tests
main-is: Main.hs
-- other-modules:
ghc-options: -Wall -O2 -threaded -funbox-strict-fields -fno-ignore-asserts "-with-rtsopts=-N"
if flag(instrumented)
ghc-prof-options: "-with-rtsopts=-xc" -fprof-auto -fprof-auto-calls
if flag(instrumented)
CPP-Options: -DASSERTIONS_ON
if flag(dev)
buildable: True
build-depends: base
, QuickCheck
, random
, unagi-bloomfilter
, primitive
, bytestring
, hashabler
else
buildable: False
benchmark bench
type: exitcode-stdio-1.0
default-language: Haskell2010
main-is: Main.hs
ghc-options: -Wall -O2 -threaded -funbox-strict-fields
ghc-options: "-with-rtsopts=-N -A50M -qa"
ghc-options: -rtsopts
ghc-prof-options: -fprof-auto -fprof-auto-calls
hs-source-dirs: benchmarks
if flag(instrumented)
CPP-Options: -DASSERTIONS_ON
if flag(dev)
buildable: True
build-depends: base
, criterion
, unagi-bloomfilter
, unordered-containers
, containers
, text
, deepseq
, random
, hashabler
else
buildable: False
executable dev-example
if !flag(dev)
buildable: False
else
build-depends:
base
, unagi-bloomfilter
-- ghc-options: -ddump-to-file -ddump-simpl -dsuppress-module-prefixes -dsuppress-uniques -ddump-core-stats -ddump-inlinings
ghc-options: -O2 -rtsopts
-- for ghc bug(?) https://ghc.haskell.org/trac/ghc/ticket/11263
-- (had to bump once again for additional setKMemberBits unrolling)
ghc-options: -fsimpl-tick-factor=1000
-- Either do threaded for eventlogging and simple timing...
-- ghc-options: -threaded -eventlog
-- and run e.g. with +RTS -N -l
hs-source-dirs: core-example
main-is: Main.hs
default-language: Haskell2010