summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-03 06:14:45 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-03 06:14:45 +0000
commit85286b53fce1ded5c4ad5a9aaea6b1a7c2e7a2b1 (patch)
treeb9507924c0cd2c70890289357a427e5dd69f979f /base/file_util.h
parentd27893f65dbd01a0d88dcda2a69f518e4b8a636d (diff)
downloadchromium_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 'base/file_util.h')
-rw-r--r--base/file_util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/base/file_util.h b/base/file_util.h
index 6277748..d52bba9 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -603,6 +603,15 @@ inline bool MakeFileUnreadable(const FilePath& path) {
#endif // UNIT_TEST
+#if defined(OS_WIN)
+ // Loads the file passed in as an image section and touches pages to avoid
+ // subsequent hard page faults during LoadLibrary. The size to be pre read
+ // is passed in. If it is 0 then the whole file is paged in. The step size
+ // which indicates the number of bytes to skip after every page touched is
+ // also passed in.
+ bool PreReadImage(const wchar_t* file_path, size_t size_to_read,
+ size_t step_size);
+#endif // OS_WIN
} // namespace file_util
// Deprecated functions have been moved to this separate header file,