From cbefd7d842945a8a7cc21770b19f41e0f3f3b205 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Mon, 6 Jun 2011 13:31:30 +0000 Subject: add internal multiplier for loopcount, to reduce variance for simple/fast tests git-svn-id: http://skia.googlecode.com/svn/trunk@1510 2bbb7eff-a529-9590-31e7-b0007b416f81 --- bench/MatrixBench.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bench/MatrixBench.cpp') diff --git a/bench/MatrixBench.cpp b/bench/MatrixBench.cpp index eb7d39f5db..d963bc7126 100644 --- a/bench/MatrixBench.cpp +++ b/bench/MatrixBench.cpp @@ -14,12 +14,15 @@ public: virtual void performTest() = 0; protected: + virtual int mulLoopCount() const { return 1; } + virtual const char* onGetName() { return fName.c_str(); } virtual void onDraw(SkCanvas* canvas) { - for (int i = 0; i < N; i++) { + int n = N * this->mulLoopCount(); + for (int i = 0; i < n; i++) { this->performTest(); } } @@ -103,6 +106,8 @@ public: init9(myr); } protected: + virtual int mulLoopCount() const { return 4; } + static inline void muladdmul(float a, float b, float c, float d, float* result) { *result = a * b + c * d; @@ -144,6 +149,8 @@ public: init9(myr); } protected: + virtual int mulLoopCount() const { return 4; } + static inline void muladdmul(float a, float b, float c, float d, float* result) { *result = SkDoubleToFloat((double)a * b + (double)c * d); @@ -180,6 +187,8 @@ public: init9(myr); } protected: + virtual int mulLoopCount() const { return 4; } + static inline void muladdmul(double a, double b, double c, double d, double* result) { *result = a * b + c * d; -- cgit v1.2.3