Closed Bug 971751 Opened 11 years ago Closed 10 years ago

Investigate removing the Java URL prefetch code from startup

Categories

(Firefox for Android Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 35

People

(Reporter: mfinkle, Assigned: mfinkle)

References

Details

Attachments

(1 file)

The java prefetch code was originally landed to power up the radio and warm DNS. We added a Gecko speculative connection in bug 966573 that does the same thing, but is also a networking connection that Gecko will reuse. The speculative connection happens in the BrowserCLH, which is ~1.5secs before we actually try to use the URL. The java prefetch happens a little sooner than the Gecko speculative connection and that might mean we get a little better headstart in powering the radio and DNS. That said, having two pieces of code that do the same type of thing is redundant, especially during startup. Given that Gecko can actually re-use the speculative connection, we would remove the java prefetch. If the java prefetch has no measureable advantage, we should remove it. We need to do some testing using cold, powered down cell radios. Launch fennec with an intent to load a URL externally. Measure how long it takes to get to "throbber stop". With and without the prefetch.
I decided to look at the startup profile when Fennec is launched with a URL. Almost half of our startups are like this, based on Telemetry. The profiles for a Nexus S and Nexus 7 are up here. Download and open in Android's Monitor app for your own viewing pleasure: http://people.mozilla.org/~mfinkle/fennec/profiles/nexuss-loadmozilla-startup-20140915.trace http://people.mozilla.org/~mfinkle/fennec/profiles/nexus7-loadmozilla-startup-newtablet-20140915.trace Looking at the "loadmozilla" profiles, I notice a few things: 1. PrefetchRunnable is KILLING us on the Nexus 7, taking almost 640ms. It's the #5 item. Digging a little, it seems like the SSL part is really hurting us. Compare this to the Nexus S where PrefetchRunnable is #426, taking only 11ms. With the PrefetchRunnable removed, I see Gecko staring to load the page faster. A profile for that is here: http://people.mozilla.org/~mfinkle/fennec/profiles/nexus7-loadmozilla-startup-noprefetch-20140915.trace
Attached patch no-prefetch v0.1Splinter Review
Removes the PrefetchRunnable and some misc stuff it used. Builds and runs fine. Let's see if this moves the needle on any of our performance dashboards.
Assignee: nobody → mark.finkle
Attachment #8490725 - Flags: review?(snorp)
Attachment #8490725 - Flags: review?(snorp) → review+
Flagging needinfo to remember to check on telemetry in a few days.
Flags: needinfo?(mark.finkle)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 35
No change in autophone. I did not expect an improvement though, since we only used the PrefetchRunnable for "http" URLs. Telemetry is showing a small improvement in the mean time to GECKOREADY. As expected, STARTUP_GEKOAPP_ACTION no longer shows "prefetch" after the code landed.
Flags: needinfo?(mark.finkle)
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: