2

GUID と Datetime のペア値の C# リストを保存する必要があります。

リストは静的で、GUID 値の存在をすばやく取得できるようにしたかったため、速度が不可欠です。

GUID のキーのリスト、辞書、またはその他の検索可能なコレクションの最良の代替手段は何ですか?

4

2 に答える 2

5

I'd just use a Dictionary<Guid, DateTime>. I'd be surprised if there was any major performance difference between using a dictionary or list, for example. I'd see how the dictionary performs and then try something else if you're finding it slow before trying to micro-optimize before you even know if it'll be a problem.

于 2013-11-04T20:20:34.310 に答える
3

http://blog.bodurov.com/Performance-SortedList-SortedDictionary-Dictionary-Hashtable

Based on experience, Dictionary<TKey, TValue> is all around the fastest/easiest way.

于 2013-11-04T20:20:52.927 に答える