Closed Bug 2005825 Opened 3 months ago Closed 26 days ago

Consider disabling the "app image" for child processes ("_disable_art_image_")

Categories

(Firefox for Android :: Performance, task)

All
Android
task

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox150 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

(Blocks 2 open bugs)

Details

(Keywords: perf-alert, Whiteboard: [group6][fenix-applink][fxdroid])

Attachments

(1 file)

The profile from bug 1985895 shows a lot of time spent in ImageSpace::Loader::InitAppImage: https://share.firefox.dev/3KRsrR7

The app image contains data that accelerates the execution of Java / Kotlin code; it's basically a dump of ART's internal C++ structures. A lot of its size is based on the number of Java / Kotlin classes that are used during startup.

Fenix has a lot of classes.

The app image is useful in our main process and speeds up Fenix main process startup.

But we don't need any of this in child processes. Our child process don't actually execute any appreciable amount of Java code; they pretty much only exist to run Gecko.

As of August 2023, Android has a super hacky way to opt out of the app image: You can include the string _disable_art_image_ in the process name, and then Android will skip the InitAppImage work for that process, at the cost of slower Java / Kotlin execution.

It's worth checking if this makes an appreciable difference for Fenix startup. We are bottlenecked on the CPU during startup, and we launch 4 child process in the first second of startup, so any reduction in CPU work for child process startup will help.

Depends on: 2006189
Assignee: nobody → mstange.moz
Status: NEW → ASSIGNED
Attachment #9533495 - Attachment description: Bug 2005825 - Rename all child processes to include the substring "_disable_app_image_", to reduce child process startup time. r=tcampbell → Bug 2005825 - Rename all child processes to include the substring "_disable_art_image_", to reduce child process startup time. r=tcampbell

Triage: adding the whiteboard label for tracking.

Whiteboard: [group6][fenix-applink]
Blocks: 2009369
Whiteboard: [group6][fenix-applink] → [group6][fenix-applink][fxdroid]

NB this flag doesn't seem to be documented anywhere in the Android APIs, so there is a worry that using it would couple us to internals of the platform which are not guaranteed to be stable and could be suddenly removed without any deprecation warnings.

Depends on: 2019013
Pushed by jnicol@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2b3484fbdfb0 https://hg.mozilla.org/integration/autoland/rev/2079b68dcfd8 Rename all child processes to include the substring "_disable_art_image_", to reduce child process startup time. r=tcampbell,geckoview-reviewers
Status: ASSIGNED → RESOLVED
Closed: 26 days ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch

(In reply to Pulsebot from comment #4)

Pushed by jnicol@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/2b3484fbdfb0
https://hg.mozilla.org/integration/autoland/rev/2079b68dcfd8
Rename all child processes to include the substring "disable_art_image",
to reduce child process startup time. r=tcampbell,geckoview-reviewers

Perfherder has detected a mozperftest performance change from push 2079b68dcfd811ac86545de31746eab52dc0a19a.

No action is required from the author; this comment is provided for informational purposes only.

Improvements Test Platform Options Absolute values [old vs new]
49% shopify-applink-startup org.mozilla.fenix:crashhelper-cpu-time android-hw-a55-14-0-aarch64-shippable 124.50 ms -> 63.83 ms
46% newssite-applink-startup org.mozilla.fenix:crashhelper-cpu-time android-hw-a55-14-0-aarch64-shippable 124.17 ms -> 66.67 ms
45% tab-restore-shopify org.mozilla.fenix:crashhelper-cpu-time android-hw-a55-14-0-aarch64-shippable 124.17 ms -> 68.67 ms
41% homeview-startup org.mozilla.fenix:crashhelper-cpu-time android-hw-a55-14-0-aarch64-shippable 111.67 ms -> 65.67 ms
8% browser_translations_perf_tiny.js engine-init-time linux1804-64-shippable 316.56 ms -> 291.85 ms
... ... ... ... ...
5% newssite-applink-startup org.mozilla.fenix:tab-cpu-time android-hw-a55-14-0-aarch64-shippable 1,347.92 ms -> 1,282.17 ms

Need Help or Information?

If you have any questions, please reach out to aesanu@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: