Skip to content

Optimize score updation #407

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

Open
v1bh475u opened this issue Feb 28, 2025 · 0 comments
Open

Optimize score updation #407

v1bh475u opened this issue Feb 28, 2025 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@v1bh475u
Copy link
Contributor

The current implementation as of upto v1 , we update the scores by iterating through all the users.
Suppose we prune a challenge, what it does is iterate through the db removing the points of that challenge.
What if instead of storing the points in the DB, we instead store pointers to the scores of solved challenges? And then for getting score of a user, we iterate through challenges and calculate the score.
What issue can this method resolve?
Consider the case of dynamic scoring. We continuously need to update the scores of the users. If we implement this, we reduce the load of the case when many users solve a particular challenge which creates a lot of threads, couple that with many users trying to fetch something from db. We are trading off this worst case with more load on every route which reduces the load that can result in downtime of the platform. We would be better off with little more load each time as compared to a lot of load a single time. This is based on the belief that number of users will be generally way more than number of challenges.

We, as of present, have only ideated on this. More research and feasibility test is required.

@v1bh475u v1bh475u added enhancement New feature or request help wanted Extra attention is needed labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant