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

Unified Diff: base/metrics/histogram_unittest.cc

Issue 1731453002: Reduce histogram creation time by avoiding import of those just created. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clear last-histogram when releasing allocator Created 4 years, 10 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 | « base/metrics/histogram_persistence.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_unittest.cc
diff --git a/base/metrics/histogram_unittest.cc b/base/metrics/histogram_unittest.cc
index beb6a71ede63c81168a851d099c9afbe8f2918bb..0b0e93344fc22f26b0f8920536cbb85a53127596 100644
--- a/base/metrics/histogram_unittest.cc
+++ b/base/metrics/histogram_unittest.cc
@@ -709,7 +709,7 @@ TEST_P(HistogramTest, FactoryTime) {
// Calculate cost of creating histograms.
TimeTicks create_start = TimeTicks::Now();
for (int i = 0; i < kTestCreateCount; ++i) {
- Histogram::FactoryGet(histogram_names[i], 0, 100, 10,
+ Histogram::FactoryGet(histogram_names[i], 1, 100, 10,
HistogramBase::kNoFlags);
}
TimeDelta create_ticks = TimeTicks::Now() - create_start;
@@ -729,7 +729,7 @@ TEST_P(HistogramTest, FactoryTime) {
const int i_mult = 6007;
static_assert(i_mult < INT_MAX / kTestCreateCount, "Multiplier too big");
int index = (i * i_mult) & (kTestCreateCount - 1);
- Histogram::FactoryGet(histogram_names[index], 0, 100, 10,
+ Histogram::FactoryGet(histogram_names[index], 1, 100, 10,
HistogramBase::kNoFlags);
}
TimeDelta lookup_ticks = TimeTicks::Now() - lookup_start;
@@ -742,7 +742,7 @@ TEST_P(HistogramTest, FactoryTime) {
// Calculate cost of accessing histograms.
HistogramBase* histogram = Histogram::FactoryGet(
- histogram_names[0], 0, 100, 10, HistogramBase::kNoFlags);
+ histogram_names[0], 1, 100, 10, HistogramBase::kNoFlags);
ASSERT_TRUE(histogram);
TimeTicks add_start = TimeTicks::Now();
for (int i = 0; i < kTestAddCount; ++i)
« no previous file with comments | « base/metrics/histogram_persistence.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698