Commit 8f40f858 authored by Charles Harrison's avatar Charles Harrison Committed by Commit Bot

HQPPerfTest: speed up test on dbg builds

Bug: 822624
Change-Id: I1ffee8e38bee2e016dc6beddd3eb05464def68a8
Reviewed-on: https://chromium-review.googlesource.com/966494
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544812}
parent 6a6a41a3
...@@ -121,9 +121,17 @@ void HQPPerfTestOnePopularURL::TearDown() { ...@@ -121,9 +121,17 @@ void HQPPerfTestOnePopularURL::TearDown() {
} }
void HQPPerfTestOnePopularURL::PrepareData() { void HQPPerfTestOnePopularURL::PrepareData() {
// Adding fake urls to db must be done before RebuildFromHistory(). This will // Adding fake urls to db must be done before RebuildFromHistory(). This will
// ensure that the index is properly populated with data from the database. // ensure that the index is properly populated with data from the database.
// Note: on debug builds these tests can be slow. Use a smaller data set in
// that case. See crbug.com/822624.
#if defined NDEBUG
constexpr size_t kSimilarUrlCount = 10000; constexpr size_t kSimilarUrlCount = 10000;
#else
LOG(ERROR) << "HQP performance test is running on a debug build, results may "
"not be accurate.";
constexpr size_t kSimilarUrlCount = 100;
#endif
for (size_t i = 0; i < kSimilarUrlCount; ++i) for (size_t i = 0; i < kSimilarUrlCount; ++i)
AddFakeURLToHistoryDB(history_backend()->db(), GeneratePopularURLRow()); AddFakeURLToHistoryDB(history_backend()->db(), GeneratePopularURLRow());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment