Skip to content

Create an async version of shared prefs #1891

Open
@kylecorry31

Description

@kylecorry31

In almost all (if not all) cases, I am not writing and directly reading a preference.

Therefore, I should be able to extend the cached preference to do the following:

  • Asynchronously get all prefs when initially loaded
  • Fall back to synchronous get when no cache hit (ex. before it is loaded / reloaded)
  • On preference change, invalidate the cache for that pref + asynchronously reload the preference into cache

If the preference load is done on startup, in the background this should mean that most preference loads are cache hits.

  • Update CachedPreferences to preload all preferences (preload flag)
  • Update CachedPreferences to reload preference after it's changed
  • Verify performance improvement
  • Move GPS/steps cache to separate shared prefs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions