Code Monkey home page Code Monkey logo

xxhash's Introduction

Data.Digest.XXHash

This is an implementation of the xxHash algorithm in haskell.

It's about as fast as an alder32 checksum written in C (zlib).

You can find benchmarks here.

xxhash's People

Contributors

christian-marie avatar brandonhamilton avatar maxdaten avatar

Stargazers

Patsakula Nikita avatar Ben Orchard avatar Maxim Avanov avatar Abdalaziz Rashid avatar zypeh avatar Alexander Bondarenko avatar  avatar Nikolai Kuklin avatar Márk Bartos avatar Michael J Klein avatar  avatar Thomas Jakway avatar weakish avatar Yann Collet avatar  avatar dicioccio lucas avatar

Watchers

 avatar James Cloos avatar  avatar Nikolai Kuklin avatar  avatar

xxhash's Issues

benchmark build failure

As seen on the stackage build server (building with ghc-8.2):

Building benchmark 'bench' for xxhash-0.0.2..
[1 of 1] Compiling Main             ( bench/Bench.hs, dist/build/bench/bench-tmp/Main.o )

bench/Bench.hs:17:10: error:
    • No instance for (GHC.Generics.Generic M32.Hash32)
        arising from a use of ‘Control.DeepSeq.$dmrnf’
    • In the expression: Control.DeepSeq.$dmrnf @M32.Hash32
      In an equation for ‘rnf’: rnf = Control.DeepSeq.$dmrnf @M32.Hash32
      In the instance declaration for ‘NFData M32.Hash32’
   |
17 | instance NFData M32.Hash32
   |          ^^^^^^^^^^^^^^^^^

Consider using hashabler to support hashing arbitrary types?

Would you be interested in merging changes that permitted hashing of arbitrary Hashable types from my hashabler package? The resulting hash functions would look something like:

xxHash :: Hashable a=> a -> XXHash

where a may also be ByteString. This would allow hashing of arbitrary haskell values in a performant way (without needing to marshal to a bytestring first), and cross-platform consistent way, etc.

Let me know if you're interested and would like more details about what that might look like.

linking failure against ghc-8.10.1

As it has some xxhash bundled:

xxhash ‰ cabal bench
Build profile: -w ghc-8.10.1 -O1
In order, the following will be built (use -v for more details):
 - xxhash-0.0.2 (bench:bench) (first run)
Preprocessing benchmark 'bench' for xxhash-0.0.2..
Building benchmark 'bench' for xxhash-0.0.2..
Linking /tmp/xxhash/dist-newstyle/build/x86_64-linux/ghc-8.10.1/xxhash-0.0.2/b/bench/build/bench/bench ...
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ghc-8.10.1/rts/libHSrts.a(xxhash.o): in function `XXH32':

/var/tmp/portage/dev-lang/ghc-8.10.1/work/ghc-8.10.1/rts/xxhash.c:321:0: error:
     multiple definition of `XXH32'; /tmp/xxhash/dist-newstyle/build/x86_64-linux/ghc-8.10.1/xxhash-0.0.2/build/libHSxxhash-0.0.2-inplace.a(xxhash.o):xxhash.c:(.text+0x0): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ghc-8.10.1/rts/libHSrts.a(xxhash.o): in function `XXH32_update':

/var/tmp/portage/dev-lang/ghc-8.10.1/work/ghc-8.10.1/rts/xxhash.c:437:0: error:
     multiple definition of `XXH32_update'; /tmp/xxhash/dist-newstyle/build/x86_64-linux/ghc-8.10.1/xxhash-0.0.2/build/libHSxxhash-0.0.2-inplace.a(xxhash.o):xxhash.c:(.text+0x1e0): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ghc-8.10.1/rts/libHSrts.a(xxhash.o): in function `XXH32_digest_endian':

/var/tmp/portage/dev-lang/ghc-8.10.1/work/ghc-8.10.1/rts/xxhash.c:451:0: error:
     multiple definition of `XXH32_digest'; /tmp/xxhash/dist-newstyle/build/x86_64-linux/ghc-8.10.1/xxhash-0.0.2/build/libHSxxhash-0.0.2-inplace.a(xxhash.o):xxhash.c:(.text+0x460): first defined here
collect2: error: ld returned 1 exit status
`x86_64-pc-linux-gnu-gcc' failed in phase `Linker'. (Exit code: 1)

xxh3

xxh3 is included in newer xxhash and has increased performance. Could the bundled library be updated?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.