Closed Bug 838223 Opened 12 years ago Closed 12 years ago

lazy load gallery features to improve startup speed

Categories

(Firefox OS Graveyard :: Gaia::Gallery, defect)

x86
macOS
defect
Not set
normal

Tracking

(blocking-b2g:tef+, b2g18 fixed, b2g18-v1.0.1 verified)

VERIFIED FIXED
blocking-b2g tef+
Tracking Status
b2g18 --- fixed
b2g18-v1.0.1 --- verified

People

(Reporter: djf, Assigned: djf)

References

Details

(Whiteboard: [LOE:S])

Attachments

(1 file)

Gallery doesn't need to load all of its scripts at startup. The photo editing features, for example, could be loaded after initialization.
Marking this as blocking meta bug 817113, taking it, and requesting tef+ since we can't mark the parent bug tef+, but gallery performance is blocking tef.
Assignee: nobody → dflanagan
Blocks: 817113
blocking-b2g: --- → tef?
tef+ to clear the way for gallery work.
blocking-b2g: tef? → tef+
This should be relatively straightforward to do. My work on bug 838219 has turned into a big enough refactoring, however, that I'll probably end up addressing this bug as part of that one. On its own, I could get this landed by 2/12. But as part of the larger 838219 it is more at risk of not making it.
Whiteboard: [LOE:S]
I'm not going to be able to land bug 838219 by 2/12, so I'm going to try to do this bug independently of that one.
The linked patch is a big one, but most of the changes just move code from gallery.js to other files where it can be loaded lazily. To summarize what this patch is doing, here are the original commit messages for the various pieces of it: pick d0892ba only load edit mode code when needed pick 42406e0 load photo/video view scripts on demand pick b7076ad don't load gesture detector until we need it pick e7e23bc don't load metadata parsing code unless needed pick b7563fb get rid of spinner on startup pick aefb63e move WebGL shaders from html file to ImageEditor.js pick 71e4d3b change the db enumeration algorithm for faster startup Note the creation of a Makefile to concatenate scripts that are going to be loaded lazily. This seems to work correctly with the build system. Also I've added a local .gitignore directory so git will ignore the concatenated files. The enumeration change in initThumbnails() in gallery.js is an important one, but most of it just reverts to an older algorithm that has already been tried and tested. The new loadScript() function at the end of gallery.js is they dynamic loading mechanism. I know you're busy with your own tef+ bugs, Dale, but my other usual reviewers, James and Dominic are both on vacation.
Attachment #712799 - Flags: review?(dale)
Comment on attachment 712799 [details] link to patch on github rather large change but havent found any issues so far, its mostly restructuring. and it does have a noticeable effect on startup. I do see a big issue with images flashing the previous version when selected from the grid view, but that was visible in previous versions as well
Attachment #712799 - Flags: review?(dale) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Batch edit: Bugs still affected on b2g18 after 2/13 merge to v1.0.1 branch are affected on v1.0.1 branch.
v1-train: f029bdf67fd37c0463111f634208e171324c1e4d v1.0.1: ff0e3a141eb8b8f1f93a4d5e3a380a76aa9e482e
does not make sense to create a regression issue.
Flags: in-moztrap-
Verifying fix - gallery load time improved significantly, loading time is now 680-770 comparing to 1400-1600 on 2013-02-10-070201 build results are taken from: settings => device info => more info => developer => show time to load => launch gallery tested on Unagis running with the following builds: V1.0.1 Build 2013-03-22-07-02-03 Gecko http://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1/rev/4931ec89ebbe Gaia 85fd164691bb852f1cfaf82405df4380629ced6e V1.1.0 Build 2013-03-22-07-02-02 Gecko http://hg.mozilla.org/releases/mozilla-b2g18/rev/5aacf880400b Gaia 5a31a56b96a8fc559232d35dabf20411b9c2ca1d
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: