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)

x86_64
Windows 10
defect

Tracking

(Performance Impact:?, firefox55 fixed)

RESOLVED FIXED
mozilla55
Performance Impact ?
Tracking Status
firefox55 --- fixed

People

(Reporter: florian, Assigned: florian)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [photon-performance])

Attachments

(1 file)

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.
Whiteboard: [qf] → [qf][photon-performance]
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)
Attached patch Patch (deleted) — Splinter Review
Attachment #8863871 - Flags: review?(dteller)
Assignee: nobody → florian
Status: NEW → ASSIGNED
(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)
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+
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.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
(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.
...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.
No longer blocks: photon-performance-triage
Flags: qe-verify? → qe-verify-
Performance Impact: --- → ?
Whiteboard: [qf][photon-performance] → [photon-performance]
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: