GUID と Datetime のペア値の C# リストを保存する必要があります。
リストは静的で、GUID 値の存在をすばやく取得できるようにしたかったため、速度が不可欠です。
GUID のキーのリスト、辞書、またはその他の検索可能なコレクションの最良の代替手段は何ですか?
GUID と Datetime のペア値の C# リストを保存する必要があります。
リストは静的で、GUID 値の存在をすばやく取得できるようにしたかったため、速度が不可欠です。
GUID のキーのリスト、辞書、またはその他の検索可能なコレクションの最良の代替手段は何ですか?
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.
http://blog.bodurov.com/Performance-SortedList-SortedDictionary-Dictionary-Hashtable
Based on experience, Dictionary<TKey, TValue>
is all around the fastest/easiest way.