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

Unified Diff: bench/ChecksumBench.cpp

Issue 2208903002: Use sse4.2 CRC32 instructions to hash when available. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 4 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 | « BUILD.gn ('k') | cmake/CMakeLists.txt » ('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 4c2ac1a3962c634696a2dc35601c7cdc4130a3c3..f84cd3d3bc535db21f68e22ed74ebe4305ccab99 100644
--- a/bench/ChecksumBench.cpp
+++ b/bench/ChecksumBench.cpp
@@ -7,13 +7,14 @@
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkChecksum.h"
+#include "SkOpts.h"
#include "SkMD5.h"
#include "SkRandom.h"
#include "SkTemplates.h"
enum ChecksumType {
kMD5_ChecksumType,
- kMurmur3_ChecksumType,
+ kHash_ChecksumType,
};
class ComputeChecksumBench : public Benchmark {
@@ -40,7 +41,7 @@ protected:
const char* onGetName() override {
switch (fType) {
case kMD5_ChecksumType: return "compute_md5";
- case kMurmur3_ChecksumType: return "compute_murmur3";
+ case kHash_ChecksumType: return "compute_hash";
default: SK_ABORT("Invalid Type"); return "";
}
@@ -56,9 +57,9 @@ protected:
md5.finish(digest);
}
} break;
- case kMurmur3_ChecksumType: {
+ case kHash_ChecksumType: {
for (int i = 0; i < loops; i++) {
- volatile uint32_t result = SkChecksum::Murmur3(fData, sizeof(fData));
+ volatile uint32_t result = SkOpts::hash(fData, sizeof(fData));
sk_ignore_unused_variable(result);
}
}break;
@@ -73,4 +74,4 @@ private:
///////////////////////////////////////////////////////////////////////////////
DEF_BENCH( return new ComputeChecksumBench(kMD5_ChecksumType); )
-DEF_BENCH( return new ComputeChecksumBench(kMurmur3_ChecksumType); )
+DEF_BENCH( return new ComputeChecksumBench(kHash_ChecksumType); )
« no previous file with comments | « BUILD.gn ('k') | cmake/CMakeLists.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698