Open Bug 1937836 Opened 6 months ago Updated 29 days ago

Investigate re-enabling process prelaunching (preallocation) on Android

Categories

(GeckoView :: General, enhancement)

All
Android
enhancement

Tracking

(Not tracked)

People

(Reporter: kaya, Assigned: sinker)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [group1][fxdroid])

Attachments

(1 file, 1 obsolete file)

The process prelauncing is disabled on Android. (see Bug 1447393).

With Fission coming up, to improve the pageload performance, we should consider enabling the process prelaunching to reduce the costs caused by spawning new content processes at the time of page loads.
Enabling the pref shows improvements in pageload performance for Fission up to 17% (see perfcompare).

In the scope of this ticket, we should investigate how stable process prelaunching is at the moment, and the required work -if any- to make it stable.

See Also: → 1833222
Whiteboard: [group1][fxdroid]
Assignee: nobody → thinker.li
Blocks: 1924849
No longer blocks: 1958065
Summary: Investigate re-enabling process prelauncing on Android → Investigate re-enabling process prelaunching (preallocation) on Android

By itself, this patch will have the following effect: Once Gecko
has requested the first content process, after some delay, a
second content process will be preallocated on Android. This process
is used once a second tab is loaded or once a Fission-enabled site
is loaded. The process count limit in dom.ipc.processCount is
honored and no further processes will be preallocated once the limit
is reached.

Flipping this pref has no impact on startup times because Gecko's
PreallocatedProcessManager currently doesn't kick off preallocation
before the first time someone asks for a new content process, and
because it currently only ever kicks off a preallocation on idle.

However, in bug 1958065 and bug 1958327 we want to actually kick off
the content processes needed for startup at an earlier time, and we
need a place to store the handles to the preallocated processes. The
PreallocatedProcessManager seems like the right place to store these
handles, and we'll need the pref to be true at that point so that the
right code paths are exercised.

By flipping the pref now, we can front-load some of the risk of the
changes planned for bug 1958065 and bug 1958327.

Attachment #9480723 - Attachment is obsolete: true

(In reply to Kaya [:kaya] from comment #0)

In the scope of this ticket, we should investigate how stable process prelaunching is at the moment, and the required work -if any- to make it stable.

I used a try build with this a bit and didn't notice any trouble. And I can't think of a reason there would be trouble - it's just launching the second content process a bit earlier. The preloader code paths are already exercised on desktop. The content process launching code paths are already exercised on Android once you load a second tab. There's not really any new source of risk here.

I think we should just flip the pref. If there are problems we'll notice them.

(In reply to Kaya [:kaya] from comment #0)

With Fission coming up

Even when Fission is enabled, PreallocatedProcessManager only allocates processes until we hit the limit in dom.ipc.processCount. So at the moment we still won't have more than 2 content processes if we flip the dom.ipc.processPrelaunch.enabled pref.

Links to the code: PreallocatedProcessManagerImpl::CanAllocate() calls ContentParent::IsMaxProcessCountReached(DEFAULT_REMOTE_TYPE) which calls ContentParent::GetMaxProcessCount(DEFAULT_REMOTE_TYPE) which returns GetMaxWebProcessCount() which returns the value of the dom.ipc.processCount pref.

The try push is showing a fair amount of timeouts in the mda1+mda2 tests, i.e. the geckoview-mochitest-media tests, both on the regular Android x86-64 debug configuration, but particularly on the debug-isolated-process configuration.

There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:sinker, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(thinker.li)
Flags: needinfo?(kkaya)

This is blocked on investigating test failures.

Flags: needinfo?(thinker.li)
Flags: needinfo?(kkaya)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: