Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2251)

Unified Diff: bench/ChecksumBench.cpp

Issue 19500020: Add SkChecksum::Murmur3. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkChecksum.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ChecksumBench.cpp
diff --git a/bench/ChecksumBench.cpp b/bench/ChecksumBench.cpp
index d2497d7f16eecd27b65466814b9f39919a17bc48..b125aa4d1fe3e134ae54e98c94df8647d4b1f3c6 100644
--- a/bench/ChecksumBench.cpp
+++ b/bench/ChecksumBench.cpp
@@ -15,7 +15,8 @@
enum ChecksumType {
kChecksum_ChecksumType,
kMD5_ChecksumType,
- kSHA1_ChecksumType
+ kSHA1_ChecksumType,
+ kMurmur3_ChecksumType,
};
class ComputeChecksumBench : public SkBenchmark {
@@ -42,6 +43,8 @@ protected:
case kChecksum_ChecksumType: return "compute_checksum";
case kMD5_ChecksumType: return "compute_md5";
case kSHA1_ChecksumType: return "compute_sha1";
+ case kMurmur3_ChecksumType: return "compute_murmur3";
+
default: SK_CRASH(); return "";
}
}
@@ -70,6 +73,12 @@ protected:
sha1.finish(digest);
}
} break;
+ case kMurmur3_ChecksumType: {
+ for (int i = 0; i < N; i++) {
+ volatile uint32_t result = SkChecksum::Murmur3(fData, sizeof(fData));
+ sk_ignore_unused_variable(result);
+ }
+ }break;
}
}
@@ -83,7 +92,11 @@ private:
static SkBenchmark* Fact0(void* p) { return new ComputeChecksumBench(p, kChecksum_ChecksumType); }
static SkBenchmark* Fact1(void* p) { return new ComputeChecksumBench(p, kMD5_ChecksumType); }
static SkBenchmark* Fact2(void* p) { return new ComputeChecksumBench(p, kSHA1_ChecksumType); }
+static SkBenchmark* Fact3(void* p) { return new ComputeChecksumBench(p, kMurmur3_ChecksumType); }
+
static BenchRegistry gReg0(Fact0);
static BenchRegistry gReg1(Fact1);
static BenchRegistry gReg2(Fact2);
+static BenchRegistry gReg3(Fact3);
+
« no previous file with comments | « no previous file | include/core/SkChecksum.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698