Pre-cache max unreserved player count on process startup.

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.
main
Alex Hart 2023-01-12 09:53:40 -04:00
rodzic 564b9f47ee
commit 3738daf4a8
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

@ -214,6 +214,7 @@ public class ApplicationContext extends MultiDexApplication implements AppForegr
.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");