Skip to content

Instantly share code, notes, and snippets.

@jh3141
jh3141 / CuckooChameleon.hs
Created April 1, 2016 12:24
A function for testing insert/lookup times of cuckoo hash table with pathological data.
import Data.Hashable
import Control.Monad.ST
import qualified Data.HashTable.ST.Cuckoo as HT
data HashCollider = HashCollider String Int
deriving (Eq, Show)
instance Hashable HashCollider where
hashWithSalt salt (HashCollider name value) = salt + value
@jh3141
jh3141 / Makefile
Last active August 29, 2015 14:10 — forked from spion/a-warning.md
all: benchmark
benchmark: test-c test-clang test-g++ test-clang++ test.js test.lua
@echo "Benchmark updated at `date`" > benchmark
@echo >> benchmark
@echo '--- time ./test-c' >> benchmark
@time ./test-c >> benchmark 2>&1
@echo >> benchmark
@echo '--- time ./test-clang' >> benchmark
@time ./test-clang >> benchmark 2>&1