Open Bug 835681 Opened 7 years ago Updated 1 year ago

Remove the sync messages from BrowserElementChild startup

Categories

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

x86_64
Linux
defect

Tracking

()

Tracking Status
b2g18 + affected

People

(Reporter: cjones, Unassigned)

References

Details

(Keywords: perf)

Attachments

(1 file)

Looking at

http://people.mozilla.com/~bgirard/cleopatra/#report=427594015c91a5fedfa918262af7c4767efa68c5

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 application.zip.

So if we pre-open() and send over the application.zip 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.