字典<>性能 [英] Dictionary<> Performance
问题描述
我是个解释,我将有大约25万项,我将定期进行添加,删除,编辑和投票..即时知道所有条目的上/下,双方将是什么,如果有更efficiant的方式。
Im using a Dictionary, i will have around a million entries and i will be regularly be adding, removing, editing, and polling.. im wondering what the up/down sides of all the entries will be, and if there is a more efficiant way.
推荐答案
这取决于你想要做什么。如果你想快速的插入,查找和删除一个键值对存储,你不能得到更好的。
It depends what you want to do. If you want a key-value pair store with fast insertion, lookup and removal, you can't get much better.
但是,如果你想获得最小的关键,字典不会帮助你多少,你将不得不搜索整个字典。一个SortedDictionary可能是在这种情况下更好。
But if you want to get the smallest key, a dictionary won't help you much as you will have to search the entire dictionary. A SortedDictionary might be better in this case.
最合适的数据结构取决于你将存储哪些数据,以及如何将使用它。因为你还没有告诉我们要么,这是很难给出一个具体的回答你的问题。
The most suitable data structure depends on what data you will store, and how will be using it. Since you haven't told us either, it's very hard to give a concrete answer to your question.
这篇关于字典<>性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!