Closed Bug 834548 Opened 11 years ago Closed 10 years ago

Settings menu item is disabled for 10 seconds after launching Firefox if Adblock Plus addon is installed

Categories

(Firefox for Android Graveyard :: Theme and Visual Design, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: cpeterson, Unassigned)

References

()

Details

STR:
1. Install Adblock Plus addon:
https://addons.mozilla.org/en-us/android/addon/adblock-plus/
2. Quit Firefox and kill the process using the Android task switcher
3. Launch Firefox
4. Quickly open Firefox's drop-down menu
5. Watch the "Settings" menu item

RESULT:
The "Settings" menu item is disabled and grayed out for almost 10 seconds!
The "Settings" menu is entirely dependent on Gecko starting, loading and telling Java it is ready (using the "Gecko:Ready" message iirc). How long does it take without Adblock Plus installed?
(In reply to Mark Finkle (:mfinkle) from comment #1)
> How long does it take without Adblock Plus installed?

With Adblock Plus, 10 seconds. Without Adblock Plus, 2 seconds.
If you get a chance, you could profile using the "Gecko Profiler" to see what the hotspot might be
My intuition is that Gecko is waiting for Adblock Plus to complete some initialization. Perhaps Adblock Plus is "phoning home" to check for filter updates.
Someone else on irc complained about adblock yet again prompting me to find this old bug ... wonders if we could add something like the "script is busy" warning, but for addons w/loading time past some threshold
See Also: → 962702
According to Wladimir, this delay is entirely due to processing time:

---
No, the entire I/O is being performed asynchronously, we've made that change a while ago. The issue is processing the filter data we load from disk - it could theoretically be done in a worker but that wouldn't help much as it produces tons of data that would need to be sent to the main thread. We are well aware of the issue and looked into various options of optimizing the process - without significant breakthroughs unfortunately.

We are currently about to address that issue from two angles. One might help us reduce the number of filters, the other should make our code more efficient (via asm.js). Both will take a while however.
---
Blocks: 795436
(In reply to Richard Newman [:rnewman] from comment #6)
> According to Wladimir, this delay is entirely due to processing time:

Based on a Gecko Profile I have, I would agree.
Testing Nightly (01/24) on my Nexus 4 

01-24 16:08:39.906 I/ActivityManager(  598): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.mozilla.fennec/.App bnds=[384,369][572,568]} from pid 1008

01-24 16:08:53.821 D/GeckoBrowserApp( 5275): BrowserApp.onTabChanged: 0: MENU_UPDATED

~ 14 seconds before Gecko was respondent based on just seeing the 'settings' item enable itself.
I have not installed Adblock Plus addon 
but still i see delay of around 8 seconds  in enabling of settings option.
(In reply to Ashish Namdev from comment #9)
> I have not installed Adblock Plus addon 
> but still i see delay of around 8 seconds  in enabling of settings option.

1. What device are you using?
2. Do you have any other add-ons installed?
I am using samsung galaxy S-II with android 4.1.2
I have not installed any addon only enabled sync
Aaron, is that the kind of Gecko startup time we expect from an S2?
Flags: needinfo?(aaron.train)
No. I tested on two SII devices I have, both on Android 4.1.2

* Firefox 27.0 (which I assume comment #9 is using?)

From the first ActivityThread logged 

02-23 11:09:55.742 I/ActivityThread( 9006): Pub org.mozilla.firefox.health: org.mozilla.gecko.background.healthreport.HealthReportProvider

to

02-23 11:09:58.477 I/GeckoToolbar( 9006): zerdatime 749421 - Throbber stop

Was rather instantant.

Both devices do not have anything else running, nor any Task Killers or any consuming background activities.
Flags: needinfo?(aaron.train)
Aaron: a better measure of when Gecko is ready is when the Settings menu stops being greyed out -- just cold-launch, hit Menu, and watch. Informal timing is fine.
It is near instant after launch, ~1-2 seconds most.
Galaxy S2 with Android 4.2.2, sync enabled, ~3-4 seconds (with AdBlock it's extremely slow, but it's a known problem).
Nexus 4 with Android 4.4.2 

The problem is not only the setting menu, loading the first page (cold startup) with adblock plus installed is very slow.

Example: search "ciao" on google, dolphin finds the results in 2sec and firefox+ABP in 21sec, both cold startup.
AdBlock Plus 2.6 has a number of perf improvements

* Made sure Adblock Plus initialization doesn’t delay Firefox startup.
* Switched to a faster way to access Adblock Plus data on disk.
* Fixed regression in Adblock Plus 2.5.1: Adblock Plus initialization takes longer for each new window opened.

Is this still an issue when using 2.6?
I just tested Adblock Plus 2.6 with Fennec Beta 29 and startup performance was much improved. The Settings menu was enabled in less than 1 second instead of 10 seconds.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.