I want some advise on the best way to store and access with minimum memory footprint and maximum access performance.
Eg. for each vehicle make i want to store model and name.
i have some thoughts below:
Option 1:
Dictionary<string, Dictionary<string, string>> values = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> list = new Dictionary<string, string>();
list.Add("2001", "Jetta S");
list.Add("2002", "Jetta SE");
list.Add("2002", "Jetta LE");
values.Add("VolksWagen", list);
Option 2:
Dictionary<string, List<KeyValuePair<string, string>>> values2 = new Dictionary<string, List<KeyValuePair<string, string>>>();
<pre lang="xml">List<KeyValuePair<string, string>> list2 = new List<KeyValuePair<string, string>>();
list2.Add(new KeyValuePair<string, string>("2001", "Jetta S"));
list2.Add(new KeyValuePair<string, string>("2002", "Jetta SE"));
list2.Add(new KeyValuePair<string, string>("2002", "Jetta LE"));
values2.Add("VolksWagen", list2);
Option 3:
Dictionary<string, List<string>> values1 = new Dictionary<string, List<string>>();
List<string> list1 = new List<string>();
list1.Add("2001:Jetta S");
list1.Add("2002:Jetta SE");
list1.Add("2002:Jetta LE");
values1.Add("VolksWagen", list1);
- Option 1: faster access of make and name but most memory footprint
- Option 2: fast access of make and name but more memory footprint
- Option 3: slow access of make and name (would have to parse it) but less memory footprint
there would be more than 1500 dictionaries like above.
Any suggestions for fastest access but less memory footprint is appreciated?
Thanks.