OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/perftimer.h" | 11 #include "base/perftimer.h" |
12 #include "base/shared_memory.h" | 12 #include "base/shared_memory.h" |
13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
14 #include "base/test/test_file_util.h" | 14 #include "base/test/test_file_util.h" |
15 #include "chrome/browser/visitedlink/visitedlink_master.h" | 15 #include "components/visitedlink/browser/visitedlink_master.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 using base::TimeDelta; | 19 using base::TimeDelta; |
20 | 20 |
| 21 namespace components { |
| 22 |
21 namespace { | 23 namespace { |
22 | 24 |
23 // how we generate URLs, note that the two strings should be the same length | 25 // how we generate URLs, note that the two strings should be the same length |
24 const int add_count = 10000; | 26 const int add_count = 10000; |
25 const int load_test_add_count = 250000; | 27 const int load_test_add_count = 250000; |
26 const char added_prefix[] = "http://www.google.com/stuff/something/foo?session=8
5025602345625&id=1345142319023&seq="; | 28 const char added_prefix[] = "http://www.google.com/stuff/something/foo?session=8
5025602345625&id=1345142319023&seq="; |
27 const char unadded_prefix[] = "http://www.google.org/stuff/something/foo?session
=39586739476365&id=2347624314402&seq="; | 29 const char unadded_prefix[] = "http://www.google.org/stuff/something/foo?session
=39586739476365&id=2347624314402&seq="; |
28 | 30 |
29 // Returns a URL with the given prefix and index | 31 // Returns a URL with the given prefix and index |
30 GURL TestURL(const char* prefix, int i) { | 32 GURL TestURL(const char* prefix, int i) { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 double cold_sum = 0, hot_sum = 0; | 191 double cold_sum = 0, hot_sum = 0; |
190 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { | 192 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { |
191 cold_sum += cold_load_times[i]; | 193 cold_sum += cold_load_times[i]; |
192 hot_sum += hot_load_times[i]; | 194 hot_sum += hot_load_times[i]; |
193 } | 195 } |
194 LogPerfResult("Visited_link_cold_load_time", | 196 LogPerfResult("Visited_link_cold_load_time", |
195 cold_sum / cold_load_times.size(), "ms"); | 197 cold_sum / cold_load_times.size(), "ms"); |
196 LogPerfResult("Visited_link_hot_load_time", | 198 LogPerfResult("Visited_link_hot_load_time", |
197 hot_sum / hot_load_times.size(), "ms"); | 199 hot_sum / hot_load_times.size(), "ms"); |
198 } | 200 } |
| 201 |
| 202 } // namespace components |
OLD | NEW |