Closed
Bug 1361087
Opened 8 years ago
Closed 8 years ago
Loading osfile_shared_allthreads.jsm does main thread IO on Windows
Categories
(Toolkit Graveyard :: OS.File, defect, P1)
Tracking
(Performance Impact:?, firefox55 fixed)
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: florian, Assigned: florian)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [photon-performance])
Attachments
(1 file)
(deleted),
patch
|
Yoric
:
review+
|
Details | Diff | Splinter Review |
See this profile: https://perfht.ml/2p1uyD1
Loading osfile_shared_allthreads.jsm (which is done during early startup) initializes the OSFileConstantsService at http://searchfox.org/mozilla-central/rev/3dc6ceb42746ab40f1441e1e659ffb8f62ae78e3/toolkit/components/osfile/modules/osfile_shared_allthreads.jsm#94
This creates the nsSystemInfo service at http://searchfox.org/mozilla-central/rev/3dc6ceb42746ab40f1441e1e659ffb8f62ae78e3/dom/system/OSFileConstants.cpp#326
And in the profile linked above, this spends 276ms of startup time doing main thread IO in a gethostname call (we don't seem to use this information).
I think some of this should be lazy-ified, if not completely ifdef'ed out on Windows, as this comment makes me think this has very little value there:
// Get the umask from the system-info service.
// The property will always be present, but it will be zero on
// non-Unix systems.
Assignee | ||
Updated•8 years ago
|
Blocks: photon-performance-triage
Whiteboard: [qf] → [qf][photon-performance]
Updated•8 years ago
|
Flags: qe-verify?
Priority: -- → P2
#ifdef-ing it away on Windows definitely makes sense.
I think that we could replace this directly with `nsSystemInfo::gUserMask`, which shouldnt' need to initialize the nsSystemInfo service.
Flags: needinfo?(florian)
Assignee | ||
Comment 2•8 years ago
|
||
Attachment #8863871 -
Flags: review?(dteller)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → florian
Status: NEW → ASSIGNED
Comment 3•8 years ago
|
||
We sort of have the same bug in the download manager too!
<http://searchfox.org/mozilla-central/rev/ae8c2e2354db652950fe0ec16983360c21857f2a/toolkit/components/downloads/nsDownloadManager.cpp#3381>
Updated•8 years ago
|
Assignee | ||
Comment 4•8 years ago
|
||
(In reply to :Ehsan Akhgari (super long backlog, slow to respond) from comment #3)
> We sort of have the same bug in the download manager too!
>
> <http://searchfox.org/mozilla-central/rev/
> ae8c2e2354db652950fe0ec16983360c21857f2a/toolkit/components/downloads/
> nsDownloadManager.cpp#3381>
Hopefully that download manager code doesn't run during early startup, so I don't think we really need to apply the fix there. Especially if bug 1361495 gets fixed.
Flags: needinfo?(florian)
Updated•8 years ago
|
Iteration: --- → 55.5 - May 15
Priority: P2 → P1
Comment on attachment 8863871 [details] [diff] [review]
Patch
Review of attachment 8863871 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/OSFileConstants.cpp
@@ +326,5 @@
>
> // Get the umask from the system-info service.
> // The property will always be present, but it will be zero on
> // non-Unix systems.
> + // It's initialized before nsSystemInfo::Init, so we don't need to
Nit: instead of "It", writing `nsSystemInfo::gUserMask` might be clearer.
Also, the important part is that `nsSystemInfo::gUserMask` is already initialized, by `NS_InitXPCOM2` (iirc).
Attachment #8863871 -
Flags: review?(dteller) → review+
Assignee | ||
Comment 6•8 years ago
|
||
Try looks green enough: https://treeherder.mozilla.org/#/jobs?repo=try&revision=a62a0c2dc743f8d7f36bf877b9acaa8164a00b99
Pushed by florian@queze.net:
https://hg.mozilla.org/integration/mozilla-inbound/rev/427d001e5539
Loading osfile_shared_allthreads.jsm should not initialize the system-info service (as it does main thread IO on Windows), r=Yoric.
Comment 8•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Comment 9•8 years ago
|
||
(In reply to :Ehsan Akhgari (super long backlog, slow to respond) from comment #3)
> We sort of have the same bug in the download manager too!
>
> <http://searchfox.org/mozilla-central/rev/
> ae8c2e2354db652950fe0ec16983360c21857f2a/toolkit/components/downloads/
> nsDownloadManager.cpp#3381>
That code is no more used in Firefox, we now use jsdownloads.
Comment 10•8 years ago
|
||
...and now it's time to tackle bug 851471 and dependencies, as this unused code comes up all the time. I'll see what I can do today.
Assignee | ||
Updated•8 years ago
|
No longer blocks: photon-performance-triage
Assignee | ||
Updated•8 years ago
|
Blocks: photon-performance-triage
Updated•8 years ago
|
Flags: qe-verify? → qe-verify-
Updated•3 years ago
|
Performance Impact: --- → ?
Whiteboard: [qf][photon-performance] → [photon-performance]
Updated•2 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•