Closed
Bug 632490
Opened 13 years ago
Closed 13 years ago
Use a content-type hint for the channel in mozJSSubScriptLoader::LoadSubScript
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla2.0b12
Tracking | Status | |
---|---|---|
fennec | 2.0b5+ | --- |
People
(Reporter: mbrubeck, Assigned: mbrubeck)
References
Details
(Keywords: mobile, perf, Whiteboard: [has-patch])
Attachments
(1 file, 1 obsolete file)
945 bytes,
patch
|
mbrubeck
:
review+
|
Details | Diff | Splinter Review |
Bug 632177 shows that GetMIMEInfoFromOS can be very expensive for Fennec. This function is called by nsFileChannel::MakeFileInputStream, which is triggered by NS_OpenURI when a file: URI is passed to LoadSubScript. This patch avoids the expensive GetMIMEInfoFromOS call by setting a MIME-type "hint" on the channel. Nominating for blocking-fennec because this impacts Fennec startup time (which makes heavy use of LoadSubScript). With this patch plus the patch from bug 632417, I can get all the way through Fennec startup without any calls to GetMIMEInfoFromOS.
Attachment #510695 -
Flags: review?(cdleary)
Assignee | ||
Updated•13 years ago
|
Assignee: general → mbrubeck
Status: NEW → ASSIGNED
Comment on attachment 510695 [details] [diff] [review] patch >- rv = NS_OpenURI(getter_AddRefs(instream), uri, serv, >- nsnull, nsnull, nsIRequest::LOAD_NORMAL, >- getter_AddRefs(chan)); >+ } >+ >+ rv = NS_NewChannel(getter_AddRefs(chan), uri, serv, >+ nsnull, nsnull, nsIRequest::LOAD_NORMAL); >+ if (NS_SUCCEEDED(rv)) >+ { >+ chan->SetContentType(NS_LITERAL_CSTRING("application/javascript")); >+ rv = chan->Open(getter_AddRefs(instream)); >+ } >+ Add a comment here explaining why we don't use the more-concise OpenURI (which would probably like a content-hint overload later?), and r=shaver.
Attachment #510695 -
Flags: review?(cdleary) → review+
Comment 2•13 years ago
|
||
(In reply to comment #1) > > Add a comment here explaining why we don't use the more-concise OpenURI (which > would probably like a content-hint overload later?), and r=shaver. What would be even nice is having NS_OpenURI do a WARNING() that it's slow :)
Updated•13 years ago
|
tracking-fennec: ? → 2.0b5+
Assignee | ||
Comment 3•13 years ago
|
||
Attachment #510695 -
Attachment is obsolete: true
Attachment #510801 -
Flags: review+
Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Whiteboard: [has-patch]
Assignee | ||
Comment 4•13 years ago
|
||
This looked good on try; pushing to m-c: http://hg.mozilla.org/mozilla-central/rev/682d008059c6
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•13 years ago
|
Target Milestone: --- → mozilla2.0b12
Comment 5•13 years ago
|
||
looks like checkin-needed is not useful anymore? Set it back if I'm wrong.
Keywords: checkin-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•