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

Optimize Upvoted Users. #485

Open
ngwattcos opened this issue Feb 16, 2021 · 0 comments
Open

Optimize Upvoted Users. #485

ngwattcos opened this issue Feb 16, 2021 · 0 comments

Comments

@ngwattcos
Copy link
Member

Currently, upvotedUsers in FireDiscussionQuestion is a string array. This translates to an array in Firestore, which is essentially a map with the index of each upvoted user as the key. I'm not 100% on this but I believe this translates to an O(n) lookup time.

If we convert upvotedUsers: Record<string, {}> to mimic a set (and have Firestore updated to store upvotedUsers as a map) then we may see some performance benefit :')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant