diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-03 06:14:45 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-03 06:14:45 +0000 |
commit | 85286b53fce1ded5c4ad5a9aaea6b1a7c2e7a2b1 (patch) | |
tree | b9507924c0cd2c70890289357a427e5dd69f979f /chrome_frame/test/perf | |
parent | d27893f65dbd01a0d88dcda2a69f518e4b8a636d (diff) | |
download | chromium_src-85286b53fce1ded5c4ad5a9aaea6b1a7c2e7a2b1.zip chromium_src-85286b53fce1ded5c4ad5a9aaea6b1a7c2e7a2b1.tar.gz chromium_src-85286b53fce1ded5c4ad5a9aaea6b1a7c2e7a2b1.tar.bz2 |
Changing the pre-reading of chrome.dll to read it as an image section instead. XP ignores pages read as data
while mapping image sections. This shows a reasonable improvement in cold startup performance on XP.
This change only comes into effect for headless mode which enables us to try out the effect on the perf bots
and for chrome frame processes.
Code mostly written by Amit.
Added a chrome frame perf tests which measures LoadLibrary in cold mode with pre-reading.
Bug=45510
Review URL: http://codereview.chromium.org/2805064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51594 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/perf')
-rw-r--r-- | chrome_frame/test/perf/chrome_frame_perftest.cc | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc index e22b143..614cb0d 100644 --- a/chrome_frame/test/perf/chrome_frame_perftest.cc +++ b/chrome_frame/test/perf/chrome_frame_perftest.cc @@ -12,6 +12,7 @@ #include "chrome_tab.h" // Generated from chrome_tab.idl. #include "base/file_path.h" +#include "base/file_util.h" #include "base/path_service.h" #include "base/process_util.h" #include "base/registry.h" @@ -404,26 +405,42 @@ class ChromeFrameStartupTestActiveX : public ChromeFrameStartupTest { // This class measures the load time of chrome and chrome frame binaries class ChromeFrameBinariesLoadTest : public ChromeFrameStartupTestActiveX { + static const size_t kStepSize = 4 * 1024; + public: + ChromeFrameBinariesLoadTest() + : pre_read_(false), + step_size_(kStepSize), + bytes_to_read_(0) {} + protected: virtual void RunStartupTestImpl(TimeTicks* start_time, TimeTicks* end_time) { *start_time = TimeTicks::Now(); + if (pre_read_) { + EXPECT_TRUE(file_util::PreReadImage(chrome_exe_.value().c_str(), + bytes_to_read_, + step_size_)); + EXPECT_TRUE(file_util::PreReadImage(chrome_dll_.value().c_str(), + bytes_to_read_, + step_size_)); + } + HMODULE chrome_exe = LoadLibrary(chrome_exe_.value().c_str()); - ASSERT_TRUE(chrome_exe != NULL); + EXPECT_TRUE(chrome_exe != NULL); HMODULE chrome_dll = LoadLibrary(chrome_dll_.value().c_str()); - ASSERT_TRUE(chrome_dll != NULL); - - HMODULE chrome_tab_dll = LoadLibrary(chrome_frame_dll_.value().c_str()); - ASSERT_TRUE(chrome_tab_dll != NULL); + EXPECT_TRUE(chrome_dll != NULL); *end_time = TimeTicks::Now(); FreeLibrary(chrome_exe); FreeLibrary(chrome_dll); - FreeLibrary(chrome_tab_dll); } + + bool pre_read_; + size_t bytes_to_read_; + size_t step_size_; }; // This class provides functionality to run the startup performance test for @@ -929,21 +946,42 @@ TEST_F(ChromeFrameBinariesLoadTest, PerfWarm) { } TEST_F(ChromeFrameStartupTestActiveX, PerfCold) { + SetConfigInt(L"PreRead", 0); FilePath binaries_to_evict[] = { gears_dll_, avcodec52_dll_, avformat52_dll_, avutil50_dll_, chrome_exe_, chrome_dll_, chrome_frame_dll_}; RunStartupTest("cold", "t", "about:blank", true /* cold */, arraysize(binaries_to_evict), binaries_to_evict, false /* not important */, false); + DeleteConfigValue(L"PreRead"); +} + +TEST_F(ChromeFrameStartupTestActiveX, PerfColdPreRead) { + SetConfigInt(L"PreRead", 1); + FilePath binaries_to_evict[] = { gears_dll_, avcodec52_dll_, + avformat52_dll_, avutil50_dll_, chrome_exe_, chrome_dll_, + chrome_frame_dll_}; + RunStartupTest("cold_preread", "t", "about:blank", true /* cold */, + arraysize(binaries_to_evict), binaries_to_evict, + false /* not important */, false); + DeleteConfigValue(L"PreRead"); } TEST_F(ChromeFrameBinariesLoadTest, PerfCold) { - FilePath binaries_to_evict[] = {chrome_exe_, chrome_dll_, chrome_frame_dll_}; + FilePath binaries_to_evict[] = {chrome_exe_, chrome_dll_}; RunStartupTest("binary_load_cold", "t", "", true /* cold */, arraysize(binaries_to_evict), binaries_to_evict, false /* not important */, false); } +TEST_F(ChromeFrameBinariesLoadTest, PerfColdPreRead) { + FilePath binaries_to_evict[] = {chrome_exe_, chrome_dll_}; + pre_read_ = true; + RunStartupTest("binary_load_cold_preread", "t", "", true /* cold */, + arraysize(binaries_to_evict), binaries_to_evict, + false /* not important */, false); +} + TEST_F(ChromeFrameStartupTestActiveXReference, PerfWarm) { RunStartupTest("warm", "t_ref", "about:blank", false /* cold */, 0, NULL, true /* important */, false); |