Skip to content
Browse files

Added refresh script, commented test file.

 * Script refreshes the local smhasher project from upstream repo.
  • Loading branch information...
1 parent 83f51c1 commit c1635a01691bc2fa304395aa0837a97eb97bf84d @phensley committed Apr 23, 2011
Showing with 20 additions and 5 deletions.
  1. +3 −0 .gitignore
  2. +11 −0 refresh.sh
  3. +6 −5 test.py
View
3 .gitignore
@@ -0,0 +1,3 @@
+build
+murmur3.so
+
View
11 refresh.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+SVNURL=http://smhasher.googlecode.com/svn/trunk/
+ROOT=`cd \`dirname $0\`; pwd`
+
+if [[ -d $ROOT/smhasher ]] ; then
+ mv $ROOT/smhasher $ROOT/smhasher_prev_`date +'%Y%m%d%H%M%S'`
+fi
+
+svn export $SVNURL $ROOT/smhasher
+
View
11 test.py
@@ -2,14 +2,15 @@
import murmur3
import timeit
-print murmur3.murmur3_x86_64('samplebias', 0)
+# without seed
+print murmur3.murmur3_x86_64('samplebias')
+# with seed value
print murmur3.murmur3_x86_64('samplebias', 123)
-print murmur3.murmur3_x64_64('samplebias', 0)
-print murmur3.murmur3_x64_64('samplebias', 123)
+# timing comparison with str __hash__
t = timeit.Timer("murmur3.murmur3_x86_64('hello')", "import murmur3")
-print t.timeit()
+print 'murmur3:', t.timeit()
t = timeit.Timer("str.__hash__('hello')")
-print t.timeit()
+print 'str.__hash__:', t.timeit()

0 comments on commit c1635a0

Please sign in to comment.
Something went wrong with that request. Please try again.