Closed
Bug 724177
Opened 13 years ago
Closed 13 years ago
30-50ms (5%) Firefox startup speed optimization on Windows in nsLocalFileWin
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: bbondy, Assigned: bbondy)
References
Details
Attachments
(2 files)
(deleted),
image/png
|
Details | |
(deleted),
patch
|
jimm
:
review+
|
Details | Diff | Splinter Review |
I was profiling nsLocalFileWin and noticed a slowdown on Windows startup.
About 30-60ms was spent copying a single file on startup.
The file copy happens on the *main thread*.
The file that is copied is sessionStore.js to sessionstore.bak.
The file is <1KB on my profile and tests, but I've seen this file up to 400KB on my other unused profiles.
The slowdown happens after mozilla::StartupTimeline::FIRST_PAINT but before StartupTimeline::SESSION_RESTORED.
The slowdown was completely removed and accounted for 30ms-60ms of startup time.
Bug 545650 introduced the no buffering flag when copying files to solve a bug for network drives. This landed in March 2011. On startup, we use the flag for copying sessionstore to a backup location, and this location is not on a network drive.
With the flag the copy takes 30-60ms. Without the flag the copy takes less than 1ms.
I've noticed this file copy operation using xperf in the past, but this optimization was done using my local simple profiler independent of that.
I confirmed these findings using the about:startup extension.
The 20 run average for session restored is 1016.27 vs 963.14 (53.13ms savings)
Please see the attached screenshot for a breakdown.
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #594370 -
Flags: review?(jmathies)
See also Bug 716174.
Assignee | ||
Comment 3•13 years ago
|
||
Thanks for the heads up khuey, I put some info in that bug about the post effects after this lands.
Assignee | ||
Comment 4•13 years ago
|
||
jimm: I tried the remote drive detection code with both mapped drive paths and UNC paths by the way.
Assignee | ||
Comment 5•13 years ago
|
||
With the browser open for only a couple minutes by the way there were 5 other copy calls, so this should save time in general as well.
Comment 8•13 years ago
|
||
Comment on attachment 594370 [details] [diff] [review]
Patch v1.
Review of attachment 594370 [details] [diff] [review]:
-----------------------------------------------------------------
Nice little bit of optimization - thanks!
Attachment #594370 -
Flags: review?(jmathies) → review+
Assignee | ||
Comment 9•13 years ago
|
||
Thanks for the review! Pushed to try:
https://tbpl.mozilla.org/?tree=Try&rev=6909a52f8357
Assignee | ||
Comment 10•13 years ago
|
||
Target Milestone: --- → mozilla13
Comment 11•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Hardware: x86_64 → All
Resolution: --- → FIXED
Version: unspecified → Trunk
You need to log in
before you can comment on or make changes to this bug.
Description
•