aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@google.com>2015-11-13 07:07:47 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-13 07:07:47 -0800
commit0274efbd3d2c3b2fba2b4212347159a20050038d (patch)
tree938361c44fba7b2f2b2f8bde112833df571258b0 /bench
parent64c4728c70001ed074fecf5c4e083781987b12e9 (diff)
Revert of Switch uses of SkChecksum::Compute to Murmur3. (patchset #2 id:20001 of https://codereview.chromium.org/1436973003/ )
Reason for revert: I would not have expected this to change any images. Looks like it's changed both MSAA and non-MSAA GMs: 1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac&unt=true&head=true&query=source_type%3Dgm">https://gold.skia.org/search2?blame=1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac&unt=true&head=true&query=source_type%3Dgm Original issue's description: > Switch uses of SkChecksum::Compute to Murmur3. > > SkChecksum::Compute is a very, very poorly distributed hash function. > This replaces all remaining uses with Murmur3. > > The only interesting stuff is in src/gpu. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac TBR=bsalomon@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1445523003
Diffstat (limited to 'bench')
-rw-r--r--bench/ChecksumBench.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/bench/ChecksumBench.cpp b/bench/ChecksumBench.cpp
index 92e7da662f..a2c282435e 100644
--- a/bench/ChecksumBench.cpp
+++ b/bench/ChecksumBench.cpp
@@ -13,6 +13,7 @@
#include "SkTemplates.h"
enum ChecksumType {
+ kChecksum_ChecksumType,
kMD5_ChecksumType,
kSHA1_ChecksumType,
kMurmur3_ChecksumType,
@@ -41,6 +42,7 @@ public:
protected:
const char* onGetName() override {
switch (fType) {
+ case kChecksum_ChecksumType: return "compute_checksum";
case kMD5_ChecksumType: return "compute_md5";
case kSHA1_ChecksumType: return "compute_sha1";
case kMurmur3_ChecksumType: return "compute_murmur3";
@@ -51,6 +53,12 @@ protected:
void onDraw(int loops, SkCanvas*) override {
switch (fType) {
+ case kChecksum_ChecksumType: {
+ for (int i = 0; i < loops; i++) {
+ volatile uint32_t result = SkChecksum::Compute(fData, sizeof(fData));
+ sk_ignore_unused_variable(result);
+ }
+ } break;
case kMD5_ChecksumType: {
for (int i = 0; i < loops; i++) {
SkMD5 md5;
@@ -83,6 +91,7 @@ private:
///////////////////////////////////////////////////////////////////////////////
+DEF_BENCH( return new ComputeChecksumBench(kChecksum_ChecksumType); )
DEF_BENCH( return new ComputeChecksumBench(kMD5_ChecksumType); )
DEF_BENCH( return new ComputeChecksumBench(kSHA1_ChecksumType); )
DEF_BENCH( return new ComputeChecksumBench(kMurmur3_ChecksumType); )