Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cache flags, distinct id and anon id in memory to avoid file IO every time #177

Merged
merged 9 commits into from
Sep 2, 2024

Conversation

marandaneto
Copy link
Member

@marandaneto marandaneto commented Sep 2, 2024

💡 Motivation and Context

Closes #176
Only read the value from the storage if it's not in memory yet.
Setters always overwrite the value in the storage and memory.
Storage only will be accessed the very first time unless the value changes async (eg flags), then the memory value is also updated.
This should reduce the main thread warnings.
All values are read and updated using lockers already.

💚 How did you test it?

unit tests already exist and they are all green

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

@marandaneto marandaneto requested a review from a team September 2, 2024 13:56
@marandaneto marandaneto marked this pull request as ready for review September 2, 2024 13:57
@marandaneto marandaneto merged commit ba8b00e into main Sep 2, 2024
6 checks passed
@marandaneto marandaneto deleted the chore/cache-flags-and-ids branch September 2, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I/O on main thread leading to UI responsiveness issues
2 participants