Skip to content

Instantly share code, notes, and snippets.

@fffej
Created February 24, 2010 07:31
Show Gist options
  • Save fffej/313217 to your computer and use it in GitHub Desktop.
Save fffej/313217 to your computer and use it in GitHub Desktop.
import Database.Redis.Protocol
import Database.Redis.ConsistentHash
import Criterion.Main
import System.IO
main = defaultMain [
bgroup "con-hash" [ bench "getNode \"banana\"" $ whnf lookupServer "banana" ]
]
where
s h = Server h "1234" stdin
ring = create [s "Server1",s "Server2",s "Server3",s "Server4",s "Server5"] 160
lookupServer = getServer ring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment