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

Unified Diff: base/vlog_unittest.cc

Issue 3578004: If VlogTest.Perf is ran under Valgrind, decrease the number of benchmark... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/vlog_unittest.cc
===================================================================
--- base/vlog_unittest.cc (revision 61039)
+++ base/vlog_unittest.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "base/time.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -68,11 +69,12 @@
"/path/to/another-not-matched.mm",
};
const int kVlogCount = arraysize(kVlogs);
+ const int kBenchmarkIterations = RunningOnValgrind() ? 30000 : 10000000;
base::TimeDelta null_elapsed;
{
VlogInfo null_vlog_info("", "");
- BENCHMARK(10000000, null_elapsed, {
+ BENCHMARK(kBenchmarkIterations, null_elapsed, {
EXPECT_NE(-1, null_vlog_info.GetVlogLevel(kVlogs[i % kVlogCount]));
});
}
@@ -80,7 +82,7 @@
{
VlogInfo small_vlog_info("0", "foo=1,bar=2,baz=3,qux=4,quux=5");
base::TimeDelta elapsed;
- BENCHMARK(10000000, elapsed, {
+ BENCHMARK(kBenchmarkIterations, elapsed, {
EXPECT_NE(-1, small_vlog_info.GetVlogLevel(kVlogs[i % kVlogCount]));
});
LOG(INFO) << "slowdown = " << GetSlowdown(null_elapsed, elapsed)
@@ -90,7 +92,7 @@
{
VlogInfo pattern_vlog_info("0", "fo*=1,ba?=2,b*?z=3,*ux=4,?uux=5");
base::TimeDelta elapsed;
- BENCHMARK(10000000, elapsed, {
+ BENCHMARK(kBenchmarkIterations, elapsed, {
EXPECT_NE(-1, pattern_vlog_info.GetVlogLevel(kVlogs[i % kVlogCount]));
});
LOG(INFO) << "slowdown = " << GetSlowdown(null_elapsed, elapsed)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698