Cost of dict
I'm looking at initialising around 5 dictionaries in a class, intended to store DateTime.now as keys, and then the vaule of some action.
The original class itself will also be stored in a dictionary, with up to 100 other instances of that class.
Will this have any serious implications in terms of overhead / speed in the long haul?
100 objects isn't that much unless you store many megabytes in them.
Having a System.DateTime as a key in a dictionary sounds odd though, since System.DateTime.Now returns at least millisecond precision (probability of a successfull lookup is minimal).
In the scope of the system the DateTime should always be unique, since it would be impossible to call the same method on the same object within a one second timeframe.
I will consider changing this in the future though
Then why use a Dictionary? Shouldn't a List or SortedList be more suitable?
Originally Posted by Magos