GeckoApp.onCreatePanelMenu is called during startup

RESOLVED FIXED in Firefox 30

Status

()

Firefox for Android
General
RESOLVED FIXED
4 years ago
2 years ago

People

(Reporter: mfinkle, Assigned: wesj)

Tracking

(Blocks: 1 bug)

Trunk
Firefox 30
All
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

GeckoApp.onCreatePanelMenu is called from GeckoApp.initialize() for SDK >= 11 here:
http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoApp.java#1432

GeckoApp.onCreatePanelMenu accounts for 8.2% (194ms) of startup on my Galaxy Nexus.

We moved the call to initialize() for some reason in bug 886528. Maybe we went too far.
Might be worth just testing this: stuff it last in the background thread initializers, and fast-init it when loading the menu.

Where's most of the time coming from? Looking up views by ID?
Hardware: ARM → All
It calls BrowserApp.onCreateOptionsMenu, which takes most of it's time in GeckoMenuInflater.inflate -> GeckoMenuInflater.parseMenu
(Assignee)

Comment 3

4 years ago
Created attachment 8369744 [details] [diff] [review]
Patch v1

This just removes these calls. I still want to make sure that we invalidate the menu at some point, so I moved that into onMenuOpened. I also moved the event handlers into BrowserApp since they're not used by any one else (Ideally we'd move all this code into the menu code, but that's a bigger refactor).
Attachment #8369744 - Flags: review?(mark.finkle)
Comment on attachment 8369744 [details] [diff] [review]
Patch v1

I'd like you to test a few situations:
* Make sure a menu item correctly toggles (Bookmark and Request Desktop, for example)
* Test on Gingerbread, ICS and newer phones, since invalidateOptionsMenu is a 11+ API and menus worked differently before it.
Attachment #8369744 - Flags: review?(mark.finkle) → review+
(Assignee)

Comment 7

4 years ago
Created attachment 8370370 [details] [diff] [review]
Patch v2

Grr. Forgot to test on a device with a software menu button. Or... didn't realize that they were different. Pushed this to try:

https://tbpl.mozilla.org/?tree=Try&rev=dea89e3ff9c0
Attachment #8369744 - Attachment is obsolete: true
Attachment #8370370 - Flags: review?(mark.finkle)
(Reporter)

Updated

4 years ago
Attachment #8370370 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/f69c9b69caab
Assignee: nobody → wjohnston
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 30
GeckoApp.onCreatePanelMenu is no longer in the startup profile.
Let this bake a few more days, but we should consider moving this to Aurora. It's still early in the cycle.
This might have caused regression bug 972327. Please convince me otherwise.
(Assignee)

Comment 13

4 years ago
Nope. It almost certainly caused that.
Depends on: 972327
You need to log in before you can comment on or make changes to this bug.