I am writing a Windows Phone app (in c#), and it has a lot of data in it.
I would like to store this data in a dictionary (or less ideally an array), but there will be about 10 000 dictionary values (spread out across 3-4 dictionaries). Do you think these dictionaries would be too big, and take up too much memory?
The dictionaries will be Dictionary<int, customClass>
It would obviously be better to use an array, but do you think it is ok to use a dictionary?
The number of items in a collection like dictionary/array/list doesn’t matter very much, 10w integers cost less than 1M(about 100,000 * 4bytes). So the memory cost mainly depends on what stores in your
CustomClass. If the class contains a few primitive properties only, it won’t cost very much memory either. You shouldn’t worry about the memory cost very much, unless you do something like loading a file’s data into on property of the class.