Skip to content

scores_percent and scores_percent_in#66

Open
dmitrypol wants to merge 3 commits into
agoragames:mainfrom
dmitrypol:master
Open

scores_percent and scores_percent_in#66
dmitrypol wants to merge 3 commits into
agoragames:mainfrom
dmitrypol:master

Conversation

@dmitrypol

Copy link
Copy Markdown

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

modsognir commented Mar 2, 2018

Copy link
Copy Markdown

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

@dmitrypol

Copy link
Copy Markdown
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
Copy Markdown

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

@dmitrypol

Copy link
Copy Markdown
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