summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortanjent@gmail.com <tanjent@gmail.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a>2011-04-02 00:50:27 +0000
committertanjent@gmail.com <tanjent@gmail.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a>2011-04-02 00:50:27 +0000
commit9915597709841dcbc213cf0eb5bf8436738208f9 (patch)
tree7421f79697b9c5f0b020a512b9d9cbe66666bc21
parentb93e1c5302173204dd30103cddfd55a60ee1ea97 (diff)
downloadsrc-9915597709841dcbc213cf0eb5bf8436738208f9.tar.gz
faster bmix64, 7.5 gigs/sec, passes all tests
make speed test do more reps git-svn-id: http://smhasher.googlecode.com/svn/trunk@106 77a7d1d3-4c08-bdc2-d393-d5859734b01a
-rw-r--r--MurmurHash3.cpp16
-rw-r--r--SpeedTest.cpp2
-rw-r--r--main.cpp2
3 files changed, 8 insertions, 12 deletions
diff --git a/MurmurHash3.cpp b/MurmurHash3.cpp
index 8334435..33eb2e8 100644
--- a/MurmurHash3.cpp
+++ b/MurmurHash3.cpp
@@ -255,23 +255,19 @@ FORCE_INLINE void bmix64 ( uint64_t & h1, uint64_t & h2,
k1 = ROTL64(k1,29);
k1 *= c2;
+ h1 ^= k1;
+ h1 = ROTL64(h1,27);
+ h1 += h2;
+ h1 = h1*3+0x52dce729;
+
k2 *= c2;
k2 = ROTL64(k2,33);
k2 *= c1;
- h1 = ROTL64(h1,27);
- h1 += h2;
- h1 ^= k1;
-
+ h2 ^= k2;
h2 = ROTL64(h2,31);
h2 += h1;
- h2 ^= k2;
-
- h1 = h1*3+0x52dce729;
h2 = h2*3+0x38495ab5;
-
- c1 = c1*3+0x7b7d159c;
- c2 = c2*3+0x6bce6396;
}
//----------
diff --git a/SpeedTest.cpp b/SpeedTest.cpp
index a6d131e..a450c53 100644
--- a/SpeedTest.cpp
+++ b/SpeedTest.cpp
@@ -12,7 +12,7 @@ void BulkSpeedTest ( pfHash hash, uint32_t seed )
{
Rand r(seed);
- const int trials = 9999;
+ const int trials = 29999;
const int blocksize = 256 * 1024;
printf("Bulk speed test - %d-byte keys\n",blocksize);
diff --git a/main.cpp b/main.cpp
index dea1838..5f8921f 100644
--- a/main.cpp
+++ b/main.cpp
@@ -68,7 +68,7 @@ HashInfo g_hashes[] =
{ MurmurHash3_x86_32, 32, 0xCB75A3F6, "Murmur3A", "MurmurHash3 for x86, 32-bit" },
{ MurmurHash3_x86_128, 128, 0x917EC4EF, "Murmur3C", "MurmurHash3 for x86, 128-bit" },
- { MurmurHash3_x64_128, 128, 0xD1CAC156, "Murmur3F", "MurmurHash3 for x64, 128-bit" },
+ { MurmurHash3_x64_128, 128, 0x9E20536F, "Murmur3F", "MurmurHash3 for x64, 128-bit" },
};