| OLD | NEW |
| 1 // Copyright (c) 2006-2008 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/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/test/test_file_util.h" | 14 #include "base/test/test_file_util.h" |
| 15 #include "chrome/browser/visitedlink_master.h" | 15 #include "chrome/browser/visitedlink/visitedlink_master.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 using base::TimeDelta; | 18 using base::TimeDelta; |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // how we generate URLs, note that the two strings should be the same length | 22 // how we generate URLs, note that the two strings should be the same length |
| 23 const int add_count = 10000; | 23 const int add_count = 10000; |
| 24 const int load_test_add_count = 250000; | 24 const int load_test_add_count = 250000; |
| 25 const char added_prefix[] = "http://www.google.com/stuff/something/foo?session=8
5025602345625&id=1345142319023&seq="; | 25 const char added_prefix[] = "http://www.google.com/stuff/something/foo?session=8
5025602345625&id=1345142319023&seq="; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 double cold_sum = 0, hot_sum = 0; | 198 double cold_sum = 0, hot_sum = 0; |
| 199 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { | 199 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { |
| 200 cold_sum += cold_load_times[i]; | 200 cold_sum += cold_load_times[i]; |
| 201 hot_sum += hot_load_times[i]; | 201 hot_sum += hot_load_times[i]; |
| 202 } | 202 } |
| 203 LogPerfResult("Visited_link_cold_load_time", | 203 LogPerfResult("Visited_link_cold_load_time", |
| 204 cold_sum / cold_load_times.size(), "ms"); | 204 cold_sum / cold_load_times.size(), "ms"); |
| 205 LogPerfResult("Visited_link_hot_load_time", | 205 LogPerfResult("Visited_link_hot_load_time", |
| 206 hot_sum / hot_load_times.size(), "ms"); | 206 hot_sum / hot_load_times.size(), "ms"); |
| 207 } | 207 } |
| OLD | NEW |