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

Unified Diff: bench/ChecksumBench.cpp

Issue 23478013: Major bench refactoring. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: merge with head agani Created 7 years, 3 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 | « bench/ChartBench.cpp ('k') | bench/ChromeBench.cpp » ('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 315402eeee7f1aaa4e86bb0119aceb477d7a9351..7cc600858304201bc84c70b75bcbc62e9df9b3d3 100644
--- a/bench/ChecksumBench.cpp
+++ b/bench/ChecksumBench.cpp
@@ -23,7 +23,6 @@ class ComputeChecksumBench : public SkBenchmark {
enum {
U32COUNT = 256,
SIZE = U32COUNT * 4,
- N = SkBENCHLOOP(100000),
};
uint32_t fData[U32COUNT];
ChecksumType fType;
@@ -52,13 +51,13 @@ protected:
virtual void onDraw(SkCanvas*) {
switch (fType) {
case kChecksum_ChecksumType: {
- for (int i = 0; i < N; i++) {
+ for (int i = 0; i < this->getLoops(); i++) {
volatile uint32_t result = SkChecksum::Compute(fData, sizeof(fData));
sk_ignore_unused_variable(result);
}
} break;
case kMD5_ChecksumType: {
- for (int i = 0; i < N; i++) {
+ for (int i = 0; i < this->getLoops(); i++) {
SkMD5 md5;
md5.update(reinterpret_cast<uint8_t*>(fData), sizeof(fData));
SkMD5::Digest digest;
@@ -66,7 +65,7 @@ protected:
}
} break;
case kSHA1_ChecksumType: {
- for (int i = 0; i < N; i++) {
+ for (int i = 0; i < this->getLoops(); i++) {
SkSHA1 sha1;
sha1.update(reinterpret_cast<uint8_t*>(fData), sizeof(fData));
SkSHA1::Digest digest;
@@ -74,7 +73,7 @@ protected:
}
} break;
case kMurmur3_ChecksumType: {
- for (int i = 0; i < N; i++) {
+ for (int i = 0; i < this->getLoops(); i++) {
volatile uint32_t result = SkChecksum::Murmur3(fData, sizeof(fData));
sk_ignore_unused_variable(result);
}
« no previous file with comments | « bench/ChartBench.cpp ('k') | bench/ChromeBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698