SettingsProvider enhanced cache
Instead of one generation tracker per table, we now use one generation tracker per setting. Change overview: https://docs.google.com/document/d/1Hoqnyu-zdqlcqoQPcan2cuV45pXxh_dLtI0kOsOVuX0/edit?resourcekey=0-UoWA1aosEP-04skWe3Ylsw The testSettingsValueConsecutiveRead now performs 10x better because the update of one setting doesn't invalidate the caches of other settings. + Changed server caching behavior so that nothing is cached until a setting is queried. + Also moves cache check to before the readable check to further reduce read-access time, since if a setting is cached, it must be readable for the caller process. BUG: 228619157 Test: atest com.android.providers.settings.GenerationRegistryTest Test: atest SettingsProviderTest Test: atest SettingsProviderPerformanceTest Test: atest android.provider.NameValueCacheTest Change-Id: Ie519dadadc13c7211a0f1f5de53f498dfc6edf77
Showing
- core/java/android/provider/Settings.java 129 additions, 121 deletionscore/java/android/provider/Settings.java
- core/tests/coretests/src/android/provider/NameValueCacheTest.java 200 additions, 59 deletions...ts/coretests/src/android/provider/NameValueCacheTest.java
- packages/SettingsProvider/Android.bp 1 addition, 0 deletionspackages/SettingsProvider/Android.bp
- packages/SettingsProvider/src/com/android/providers/settings/GenerationRegistry.java 129 additions, 80 deletions...rc/com/android/providers/settings/GenerationRegistry.java
- packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java 21 additions, 18 deletions.../src/com/android/providers/settings/SettingsProvider.java
- packages/SettingsProvider/test/src/com/android/providers/settings/GenerationRegistryTest.java 177 additions, 0 deletions...om/android/providers/settings/GenerationRegistryTest.java
Loading
Please register or sign in to comment