KISS icon indicating copy to clipboard operation
KISS copied to clipboard

Cache app list

Open TBog opened this issue 6 years ago • 5 comments

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.

TBog avatar Jan 29 '19 09:01 TBog

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.

Neamar avatar Feb 08 '19 23:02 Neamar

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.

TBog avatar Mar 04 '19 16:03 TBog

get some external memory

studmuffler420 avatar Mar 04 '20 19:03 studmuffler420

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.

TBog avatar May 10 '24 06:05 TBog

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.'

github-actions[bot] avatar Jul 19 '24 04:07 github-actions[bot]