Closed Bug 1947497 Opened 9 days ago Closed

Accessing any usecase requires the entire dependency graph for all usecases to be initialized

Categories

(Fenix :: Performance, task)

All
Android
task

Tracking

(firefox137 fixed)

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: boek, Assigned: segun)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][group1])

Attachments

(2 files)

Assignee: nobody → sfamisa
Status: NEW → ASSIGNED

Comment on attachment 9465983 [details]
app-startup-profile-before.png

During the Application's onCreate() execution, we make one call to the UseCases container, and that triggers the creation of all the dependencies of that class.

The creation of the UseCases container, then further triggers the creation of AppStore - which uses the PocketUpdatesMiddleware as one of its middlewares. The creation of this class (and its dependencies) takes significant time, and it's not needed at all during startup as seen in this profile - https://share.firefox.dev/3CSiOh0 (also shown in this photo)

Making the dependencies of the UseCases container lazy, and making the PocketStoriesService (in PocketUpdatesMiddleware) lazy helps to remove these unnecessary work from app startup

New perf compare link - thanks to :kaya for helping to fix the previous link.

Pushed by sfamisa@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2cc436ba125d Make UseCases & PocketStoriesService lazily initialized r=android-reviewers,007
Status: ASSIGNED → RESOLVED
Closed: 3 days ago
Closed: 3 days ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: