packages feed

unagi-bloomfilter-0.1.0.0: unagi-bloomfilter.cabal

name:                unagi-bloomfilter
version:             0.1.0.0
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:
  .
  <<http://i.imgur.com/t3vroKE.png>>
  .
  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:          brandon.m.simmons@gmail.com
-- 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)
      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
  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"
  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
 ghc-options: -fsimpl-tick-factor=200
 
 -- 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