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
Created attachment 8490725 [details] [diff] [review] no-prefetch v0.1 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.
Status: NEW → RESOLVED
Last Resolved: 4 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.
You need to log in before you can comment on or make changes to this bug.