Please sign in to comment.
Implement SipHash, use as our hashing function w/ 64bit hashvals
This switches our hashing function from "Jenkins's Lookup2" to SipHash. This adds a heavily modified version of https://github.com/majek/csiphash which has been modified to use a struct to store the state and allow us to add 64 bits at a time (two graphemes). It also has been modified to take 64 bit integers instead of pointers to bytes. Rewriting the CSipHash code to take a 64 bit integer is significant because it gives us a massive speedup due to much better inlining and less data copying. Some of this SipHash code was finished a month ago but only recently had I optimized it enough so that was just as fast as our current hashing function. It makes my hashing speed test file 0.5% slower, which is totally acceptable given it has been studied extensively, while our previous hash fn has not been studied for security to the best of my knowledge. We now use a 128-bit hashSecret stored in two MVMuint64's. Previously we only had a 32-bit length hashSecret (stored in a MVMuint32). The hash values are now 64-bits instead of 32-bits.
- Loading branch information...
Showing with 385 additions and 132 deletions.
- +3 −0 build/Makefile.in
- +1 −1 src/6model/reprs/MVMString.h
- +2 −2 src/core/instance.h
- +5 −4 src/moar.c
- +1 −1 src/moar.h
- +2 −2 src/profiler/heapsnapshot.c
- +52 −104 src/strings/ops.c
- +4 −0 src/strings/siphash/Makefile
- +178 −0 src/strings/siphash/csiphash.h
- +115 −0 src/strings/siphash/test.c
- +21 −17 src/strings/uthash.h
- +1 −1 src/strings/uthash_types.h
Oops, something went wrong.