KISS
KISS copied to clipboard
Cache app list
fix #1050 Please check if starting apps works while the launcher is still waiting for the providers to finish. My device is too fast to test this.
I like the idea and implementation, however I'm concerned about the cost of creating hundreds of Pojo objects to be replaced quickly?
Historically when I looked into the performance (e.g. #990 #940 and #900) object instantiation was quite expensive -- this PR would double the cost.
Maybe we can keep the general idea: we unserialize apps, then send the "load over signal", and keep loading in the background. That way, it still takes longer than before, but it is usable faster.
I can't seem to make that load function show in the profiler. If anyone can help with a speed and memory comparison of this pull and the master it would help move things along.
get some external memory
I have some info on this from my launcher.
log filter: (tag:DataHandler | tag=:Provider) & package:mine
Starting provider: QuickListProvider
Connecting to app
Connecting to contacts
Connecting to shortcuts
Starting provider: AppProvider
Starting provider: ContactsProvider
Starting provider: ShortcutsProvider
onServiceConnected ComponentInfo{rocks.tbog.tblauncher.debug/rocks.tbog.tblauncher.dataprovider.AppProvider}
onServiceConnected ComponentInfo{rocks.tbog.tblauncher.debug/rocks.tbog.tblauncher.dataprovider.ContactsProvider}
onServiceConnected ComponentInfo{rocks.tbog.tblauncher.debug/rocks.tbog.tblauncher.dataprovider.ShortcutsProvider}
Time to load AppProvider: 148ms
Time to load ContactsProvider: 421ms
Time to load ShortcutsProvider: 405ms
Starting provider: FilterProvider
Starting provider: ActionProvider
Starting provider: TagsProvider
Time to load all providers: 663ms
Reloading provider: AppProvider
Starting provider: AppProvider
executeAfterLoadOverTasks count=5
Time to load AppProvider: 1sec 20ms
My AppProvider has this code
if (mInitialLoad) {
// Use DB cache to speed things up. We'll reload after.
this.initialize(new LoadCacheApps(this));
} else {
this.initialize(new LoadAppEntry(this));
}
I have set up my AppProvider to reload after all other providers finish for the first time. From the log you can see that the first call takes 148ms and the next one over 1 second on my phone. I believe we should cache the app list so that the launcher startup is faster.
This PR is inactive because it has been open 60 days with no activity.
Remove inactive label or comment or this will be closed in 14 days.'