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

Unified Diff: bench/RefCntBench.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/RectoriBench.cpp ('k') | bench/RegionBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/RefCntBench.cpp
diff --git a/bench/RefCntBench.cpp b/bench/RefCntBench.cpp
index 26c98b9fe4c5c7edc87e5f27543ea83ade2de186..2cc768850e748766761d116cd0890e5cabe7154c 100644
--- a/bench/RefCntBench.cpp
+++ b/bench/RefCntBench.cpp
@@ -11,8 +11,7 @@
#include <memory>
enum {
- N = SkBENCHLOOP(100000),
- M = SkBENCHLOOP(2)
+ M = 2
};
class RefCntBench_Stack : public SkBenchmark {
@@ -26,7 +25,7 @@ protected:
}
virtual void onDraw(SkCanvas*) {
- for (int i = 0; i < N; ++i) {
+ for (int i = 0; i < this->getLoops(); ++i) {
SkRefCnt ref;
for (int j = 0; j < M; ++j) {
ref.ref();
@@ -64,7 +63,7 @@ protected:
virtual void onDraw(SkCanvas*) {
char memory[sizeof(PlacedRefCnt)];
- for (int i = 0; i < N; ++i) {
+ for (int i = 0; i < this->getLoops(); ++i) {
PlacedRefCnt* ref = new (memory) PlacedRefCnt();
for (int j = 0; j < M; ++j) {
ref->ref();
@@ -89,7 +88,7 @@ protected:
}
virtual void onDraw(SkCanvas*) {
- for (int i = 0; i < N; ++i) {
+ for (int i = 0; i < this->getLoops(); ++i) {
SkRefCnt* ref = new SkRefCnt();
for (int j = 0; j < M; ++j) {
ref->ref();
@@ -116,7 +115,7 @@ protected:
}
virtual void onDraw(SkCanvas*) {
- for (int i = 0; i < N; ++i) {
+ for (int i = 0; i < this->getLoops(); ++i) {
SkWeakRefCnt ref;
for (int j = 0; j < M; ++j) {
ref.ref();
@@ -147,7 +146,7 @@ protected:
virtual void onDraw(SkCanvas*) {
char memory[sizeof(PlacedWeakRefCnt)];
- for (int i = 0; i < N; ++i) {
+ for (int i = 0; i < this->getLoops(); ++i) {
PlacedWeakRefCnt* ref = new (memory) PlacedWeakRefCnt();
for (int j = 0; j < M; ++j) {
ref->ref();
@@ -172,7 +171,7 @@ protected:
}
virtual void onDraw(SkCanvas*) {
- for (int i = 0; i < N; ++i) {
+ for (int i = 0; i < this->getLoops(); ++i) {
SkWeakRefCnt* ref = new SkWeakRefCnt();
for (int j = 0; j < M; ++j) {
ref->ref();
« no previous file with comments | « bench/RectoriBench.cpp ('k') | bench/RegionBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698