Skip to content

Commit

Permalink
Pre-cache max unreserved player count on process startup.
Browse files Browse the repository at this point in the history
This call was taking up to 20ms to run on the first time we would
load a conversation. Adding a post-render call to app launch reduces
this time to 0ms, as the data has been cached by the system. Doing
it on a background thread means we do not pay for it in TTFF.
  • Loading branch information
alex-signal committed Jan 12, 2023
1 parent 564b9f4 commit 3738daf
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public void onCreate() {
.addPostRender(GroupV2UpdateSelfProfileKeyJob::enqueueForGroupsIfNecessary)
.addPostRender(StoryOnboardingDownloadJob.Companion::enqueueIfNeeded)
.addPostRender(PnpInitializeDevicesJob::enqueueIfNecessary)
.addPostRender(() -> ApplicationDependencies.getExoPlayerPool().getPoolStats().getMaxUnreserved())
.execute();

Log.d(TAG, "onCreate() took " + (System.currentTimeMillis() - startTime) + " ms");
Expand Down

0 comments on commit 3738daf

Please sign in to comment.