| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/perftimer.h" | 10 #include "base/perftimer.h" |
| 11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "chrome/browser/visitedlink_master.h" | 13 #include "chrome/browser/visitedlink_master.h" |
| 14 #include "chrome/test/test_file_util.h" | 14 #include "chrome/test/test_file_util.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 16 |
| 17 using base::TimeDelta; |
| 18 |
| 17 namespace { | 19 namespace { |
| 18 | 20 |
| 19 // how we generate URLs, note that the two strings should be the same length | 21 // how we generate URLs, note that the two strings should be the same length |
| 20 const int add_count = 10000; | 22 const int add_count = 10000; |
| 21 const int load_test_add_count = 250000; | 23 const int load_test_add_count = 250000; |
| 22 const char added_prefix[] = "http://www.google.com/stuff/something/foo?session=8
5025602345625&id=1345142319023&seq="; | 24 const char added_prefix[] = "http://www.google.com/stuff/something/foo?session=8
5025602345625&id=1345142319023&seq="; |
| 23 const char unadded_prefix[] = "http://www.google.org/stuff/something/foo?session
=39586739476365&id=2347624314402&seq="; | 25 const char unadded_prefix[] = "http://www.google.org/stuff/something/foo?session
=39586739476365&id=2347624314402&seq="; |
| 24 | 26 |
| 25 // Returns a URL with the given prefix and index | 27 // Returns a URL with the given prefix and index |
| 26 GURL TestURL(const char* prefix, int i) { | 28 GURL TestURL(const char* prefix, int i) { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { | 184 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { |
| 183 cold_sum += cold_load_times[i]; | 185 cold_sum += cold_load_times[i]; |
| 184 hot_sum += hot_load_times[i]; | 186 hot_sum += hot_load_times[i]; |
| 185 } | 187 } |
| 186 LogPerfResult("Visited_link_cold_load_time", | 188 LogPerfResult("Visited_link_cold_load_time", |
| 187 cold_sum / cold_load_times.size(), "ms"); | 189 cold_sum / cold_load_times.size(), "ms"); |
| 188 LogPerfResult("Visited_link_hot_load_time", | 190 LogPerfResult("Visited_link_hot_load_time", |
| 189 hot_sum / hot_load_times.size(), "ms"); | 191 hot_sum / hot_load_times.size(), "ms"); |
| 190 } | 192 } |
| 191 | 193 |
| OLD | NEW |