{"id":18893392,"url":"https://github.com/xtaci/rank","last_synced_at":"2025-04-15T00:31:45.461Z","repository":{"id":33286559,"uuid":"36931261","full_name":"xtaci/rank","owner":"xtaci","description":"ranking server","archived":false,"fork":false,"pushed_at":"2017-02-11T13:23:55.000Z","size":1213,"stargazers_count":24,"open_issues_count":0,"forks_count":16,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T12:51:13.356Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xtaci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-05T12:21:46.000Z","updated_at":"2024-12-12T06:45:45.000Z","dependencies_parsed_at":"2022-08-17T19:05:47.006Z","dependency_job_id":null,"html_url":"https://github.com/xtaci/rank","commit_stats":null,"previous_names":["gonet2/rank"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Frank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Frank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Frank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Frank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtaci","download_url":"https://codeload.github.com/xtaci/rank/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248984325,"owners_count":21193727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T08:13:29.283Z","updated_at":"2025-04-15T00:31:43.340Z","avatar_url":"https://github.com/xtaci.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Ranking Service(排名)\n[![Build Status](https://travis-ci.org/xtaci/rank.svg)](https://travis-ci.org/xtaci/rank)\n\n## 设计理念\n对int32类型的id, score进行排名， 并用boltdb实现持久化。      \n排名依据score进行，可以获得范围，比如［1，100］名的列表，可以定位某个玩家的排名，比如id为1234的排名。      \n排名包含无限个集合，根据id(snowflake-id)区分，用户根据业务需求创建。          \n持久化采用boltdb，零配置, 数据存储在 volume /data 。      \n\n## 性能\n采用混合策略做排名:           \n1. 数据量小于1024(暂定)的时候，采用sortedset实现, 大部分操作时间复杂度为O(n)       \n2. 超过之后采用rbtree实现, 时间复杂度O(logN)。         \n\nsortedset的紧凑存储结构能充分利用cpu cache，而对rbtree的访问基本是全部cache miss;        所以必须在达到一定数据量之后，算法时间复杂度提升才能弥补cache miss.         \n\n## 使用\n参考测试用例以及rank.proto文件\n\n## 安装\n参考Dockerfile\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtaci%2Frank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtaci%2Frank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtaci%2Frank/lists"}