Closed Bug 1602810 Opened 4 years ago Closed 4 years ago

Android Rust doesn't support PGO

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox84 fixed)

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: away, Assigned: away)

References

Details

Attachments

(1 file)

47 bytes, text/x-phabricator-request
Details | Review

Attempting to enable Rust PGO on Android fails with "error[E0463]: can't find crate for profiler_builtins".

froydnj says that Rust would likely need a change analogous to https://github.com/rust-lang/rust/pull/60476 to enable the use of profiling on this target.

Yes, building Rust with the profiler runtime enabled seems like a necessary (first?) step. Adding --enable-profiler to https://github.com/rust-lang/rust/blob/master/src/ci/docker/dist-android/Dockerfile should do the trick. We'll have to try if that causes problems with any of the targets in that file. I can r+ if you open a PR.

(In reply to Michael Woerister from comment #1)

We'll have to try if that causes problems with any of the targets in that file.

For someone unfamiliar with Rust CI, could you elaborate on how to do that? Is it a "just land the change and see if bots/people complain" or is it something that is done pre-commit (and if so, how)?

Flags: needinfo?(mwoerister)

I think trying to land the change is a good approach. Rust CI tests PRs before it merges them, so we'd see if everything builds without having to go through some kind of local setup.

That would give us a nightly version of rustc for testing. Enabling PGO support for Android should be uncontroversial.

Flags: needinfo?(mwoerister)

Good to know, thanks!

Blocks: 1623085
No longer blocks: 1623085
Depends on: 1624706

The profiling runtime is now available starting in rust 1.44 nightly-2020-03-23.

In the few things I tested I didn't see any confident changes, although libxul came out about 1% smaller. IIRC we had trouble noticing perf changes on desktop platforms as well.

Even if the perf is a wash, I still think it would be worthwhile to move android to cross-PGO when the Rust release train advances, in order to avoid this one-off special case in our build system where all shipping builds are cross-PGO except Android.

Depends on: 1644624
See Also: → 1663700

Rust 1.47 finally ships the necessary profiling libraries for this.

Assignee: nobody → dmajor
Status: NEW → ASSIGNED
Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a406f825eeba
Enable Rust PGO for Android r=nalexander
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
Regressions: 1674966
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: