Closed Bug 987456 Opened 11 years ago Closed 4 years ago

Evaluate performance of Java-to-Gecko messaging

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: rnewman, Unassigned)

Details

(Keywords: perf)

Skimming the code, it looks like there might be some gains to be had here. For example: prior to sending a message, we check launch state on GeckoThread. That currently involves synchronizing on a lock... and it doesn't even guarantee that the thread is OK when we hit the next line and send the message! It looks like the lock/enum pair could be replaced by an AtomicReference, or even a volatile enum. checkAndSetLaunchState is apparently misused or too blunt a tool: -- return value not checked: if (!ACTION_DEBUG.equals(action) && GeckoThread.checkAndSetLaunchState(GeckoThread.LaunchState.Launching, GeckoThread.LaunchState.Launched)) { GeckoThread.createAndStart(); -- hard exit on failure: if (GeckoThread.checkAndSetLaunchState(GeckoThread.LaunchState.GeckoRunning, GeckoThread.LaunchState.GeckoExiting)) { GeckoAppShell.notifyGeckoOfEvent(GeckoEvent.createBroadcastEvent("Browser:Quit", null)); } else { GeckoAppShell.systemExit(); } One might also consider simply using PENDING_EVENTS for all messages, having the Gecko thread poll that queue in its event loop rather than having Java make a native call. Profiling is needed.
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.