Closed Bug 673259 Opened 13 years ago Closed 6 years ago

Run Fennec on Android natively (without Java)

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: stechz, Unassigned)

References

Details

(Whiteboard: mobilestartupshrink)

Make Fennec work completely natively, with a Java fallback path for older platforms, if possible.

It could significantly impact startup. glandium noticed a 200msec startup delay between starting our intent and starting our native process. It also could help us share more memory with plugin-container (by using fork+wait instead of fork+exec) and make valgrind play nicely with Fennec.
Whiteboard: mobilestartupshrink
Brad, is it possible to make a completely native Fennec on Android?
Blocks: 622908
OS: All → Android
If this is possible, it will require new features from the Android 2.3 platform/SDK.  I'm not 100% certain, but I don't think these features can be linked into an app and distributed to run on versions of Android <2.3.

http://developer.android.com/sdk/android-2.3-highlights.html#DeveloperApis
(In reply to comment #1)
> Brad, is it possible to make a completely native Fennec on Android?

yes and no. We could get rid of our java code for gingerbread and later, but there will still be a java VM which will have to start up. It would be worth benchmarking bringing up a a barebones test app with just a surface view using the native path and the java path to see how much of a win it is.
I had hoped it was possible to boot the main process without the Java VM. Too bad...
This would make a dizzying array of debugging+profiling+tracing work vastly easier.  As for user-visible benefit, that's trickier.  This would enable things like bug 674996, but at the same time we need to be careful because java VMs are not known for snappy startup, and as blassey notes, by not forking the zygote we'd have to pay the JVM startup cost.

Regardless, I would love to have something like this for dev builds, if it's not going to require a huge mountain of code to maintain.
That said, we could play games like getting to first-paint without java, and then starting up the JVM on a background thread.  Not sure how feasible that would be.
According to the discussion on IRC, the Java VM would still call our main and not the other way around.

I'm not sure what we're gaining then.
Well poop.  We wouldn't get main() but rather android_main(), according to http://developer.android.com/reference/android/app/NativeActivity.html.  We would gain nothing.
Closing a Firefox for Android Graveyard bug
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.