Bug 1947497 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

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 `PocketUpdatesMiddleware` lazy helps to remove these unnecessary work from app startup
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

Back to Bug 1947497 Comment 3