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

scores_percent and scores_percent_in #66

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dmitrypol
Copy link

Enables to easily get what percentage of total scores in leaderboard has this member scored (slice of the pie).
I think this could be useful to other users, please consider for inclusion in this gem.

Conflicts:
	README.markdown
	lib/leaderboard.rb
enables to easily get slice of the pie, how much has this specific member has scored as percentage of total in the leaderboard
@modsognir
Copy link

modsognir commented Mar 2, 2018

I'm looking for something like this. Do you know off-hand how well this performs on large datasets (>1mil)?

@dmitrypol
Copy link
Author

My method is a just a wrapper around score_for_in and total_scores_in. score_for_in just calls zscore ( O(1) ). But total_scores_in might be a perf issue. I have not tested it at that scale but please let me know what you find.

@modsognir
Copy link

Thanks for the response, I'll give it a go!

@dmitrypol
Copy link
Author

NP. I will be presenting at upcoming redisconf.com and will mention this to antirez. If there were a way for Redis to return scores of ALL members that would speed up these kinds of operations.

Base automatically changed from master to main March 11, 2021 16:13
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.

2 participants