Open Bug 835681 Opened 10 years ago Updated 4 years ago

Remove the sync messages from BrowserElementChild startup


(Core :: DOM: Core & HTML, defect, P3)




Tracking Status
b2g18 + affected


(Reporter: cjones, Unassigned)



(Keywords: perf)


(1 file)

Looking at

the sync messages in _init() are consuming a lot of the profile.  By my analysis so far, I don't think they're real overhead, but they're very distracting and in a different factoring of the startup code, they could become real overhead.
Attached patch PoCSplinter Review
Not a serious patch, just for testing purposes.

With these changes, the stopwatch timing of startup doesn't seem to change (at least I can't measure a difference) which is expected, but we do have happy times: an idle event loop during early startup waiting for OnInputStreamReady()!
Aha!  The idle event loop is actually an async-sync wait on the b2g process, to return an fd for the

So if we pre-open() and send over the fd, we'll actually reduce real work and should see a win.
Component: DOM: Apps → DOM: Mozilla Extensions
(I know you're occupied with other work, but) do you have a proposal for how to avoid these messages?
Flags: needinfo?(justin.lebar+bug)
I was thinking we'd just send a blob of properties when the child starts up.  A simple hack would be to set some properties somewhere and then just read them out later.  Perhaps we could use prefs for this (using the knowledge that they won't be forwarded up to the parent)?  Otherwise it's simple to add a service.
Flags: needinfo?(justin.lebar+bug)
frame scripts can ask nsITabChild for things, in a not too terribly gross way (IIRC).
bug 835698 comment 54 implies we should eventually fix this here for a nice startup perf boost. So asking for at least tracking here.
Component: DOM: Mozilla Extensions → DOM
Keywords: perf
Priority: -- → P3
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.