{"id":16204466,"url":"https://github.com/leinlin/sortedlistdictionary","last_synced_at":"2025-03-19T07:31:20.179Z","repository":{"id":62701074,"uuid":"556677537","full_name":"leinlin/SortedListDictionary","owner":"leinlin","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-26T07:34:49.000Z","size":7,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T16:40:49.350Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leinlin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-24T09:53:33.000Z","updated_at":"2023-12-14T05:56:32.000Z","dependencies_parsed_at":"2022-11-04T17:45:33.570Z","dependency_job_id":null,"html_url":"https://github.com/leinlin/SortedListDictionary","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leinlin%2FSortedListDictionary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leinlin%2FSortedListDictionary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leinlin%2FSortedListDictionary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leinlin%2FSortedListDictionary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leinlin","download_url":"https://codeload.github.com/leinlin/SortedListDictionary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243976644,"owners_count":20377695,"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-10-10T09:58:21.534Z","updated_at":"2025-03-19T07:31:19.941Z","avatar_url":"https://github.com/leinlin.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SortedListDictionary\n\n## 速度对比：\n- 哈希表的插入、删除、查找的时间复杂度都是 O(1)；\n- 而二分查找字典的查找的时间复杂度都是 O(logn)，插入和删除为O(n+logn)\n\n## 哈希表速度快，但缺点明显，被反杀：\n\n- hash表内存占用一般是实际数据数量的3倍左右，如果是配置表这种数据量大的结构可以考虑用这种方式进行内存压缩\n- 内存中排列有序，foreach遍历的时候顺序能够得到保证，不依赖hashcode算法，帧同步游戏不会出现不同步的问题\n- 扩容速度快，直接用SIMD内存复制\n- 不存在rehash操作，查询性能稳定在 O(logn)\n- 二分表中插入数据不是第一时间进行排序，而是再插入大量数据后进行一次性排序\n\n结论对性能要求不是特别高，内存需要压缩的客户端游戏配置可以考虑。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleinlin%2Fsortedlistdictionary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleinlin%2Fsortedlistdictionary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleinlin%2Fsortedlistdictionary/lists"}